{"_id":"@bun-win32/xinput1_4","_rev":"3-7c8c85ab0666f7727101a02ec653b763","name":"@bun-win32/xinput1_4","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@bun-win32/xinput1_4","version":"1.0.0","keywords":["bun","ffi","win32","windows","xinput1_4","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/xinput1_4@1.0.0","maintainers":[{"name":"obscuritysrl","email":"stev@bell.net"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"978ad1bf1538e3edb5ea61c0f9c2127840d5c67b","tarball":"https://registry.npmjs.org/@bun-win32/xinput1_4/-/xinput1_4-1.0.0.tgz","fileCount":6,"integrity":"sha512-fxtk20BctA6GeK6gNnYA/OzKv/s9Qwq1xSv4e43w5YDGV9Kr9Z0xNcJXy532UQbcYsaoBIHRQ6ZRardWUJa1UQ==","signatures":[{"sig":"MEYCIQDZhks+1sGi/GonTRMykTRirLSqQpiqQHLKJZnhMFP9/wIhAI72esZutLAfP2sPjAf6YLoQJ8N9HkNS4+gHToMm0f6D","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13188},"main":"./index.ts","type":"module","module":"index.ts","shasum":"978ad1bf1538e3edb5ea61c0f9c2127840d5c67b","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:gamepad-radar":"bun ./example/gamepad-radar.ts","example:controller-audit":"bun ./example/controller-audit.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-fxtk20BctA6GeK6gNnYA/OzKv/s9Qwq1xSv4e43w5YDGV9Kr9Z0xNcJXy532UQbcYsaoBIHRQ6ZRardWUJa1UQ==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/xinput1_4"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 XINPUT1_4 bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.2"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/xinput1_4_1.0.0_1775852913025_0.7474966152595948","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@bun-win32/xinput1_4","version":"2.0.0","keywords":["bun","ffi","win32","windows","xinput1_4","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/xinput1_4@2.0.0","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"1917a3bc536a84f3efcc711294bc22b017c84356","tarball":"https://registry.npmjs.org/@bun-win32/xinput1_4/-/xinput1_4-2.0.0.tgz","fileCount":6,"integrity":"sha512-64af4e60Fiycm2S5xI5D19xqkmKo1MFMHRIh4r8LW+HdhdZlywoBUfQg+1BGNC1DmILtk97LoVg0V1ho1TkQHA==","signatures":[{"sig":"MEUCIQCJjzFH7PqhGkA2Yuku3AY3Q1uS8moP1WLXVEP2a0cHegIgEfjIjgu1zicVuCYtVxl15SadGwcyMau2c3vNuGu3WvI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14549},"main":"./index.ts","type":"module","module":"index.ts","shasum":"1917a3bc536a84f3efcc711294bc22b017c84356","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:gamepad-radar":"bun ./example/gamepad-radar.ts","example:controller-audit":"bun ./example/controller-audit.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"_integrity":"sha512-64af4e60Fiycm2S5xI5D19xqkmKo1MFMHRIh4r8LW+HdhdZlywoBUfQg+1BGNC1DmILtk97LoVg0V1ho1TkQHA==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/xinput1_4"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 XINPUT1_4 bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"26.3.0","dependencies":{"@bun-win32/core":"2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/xinput1_4_2.0.0_1782436012204_0.740162582873575","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"author":"Stev Peifer <stev.p@outlook.com>","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dependencies":{"@bun-win32/core":"2.0.1"},"description":"Zero-dependency, zero-overhead Win32 XINPUT1_4 bindings for Bun (FFI) on Windows.","devDependencies":{"@types/bun":"latest"},"exports":{".":"./index.ts"},"license":"MIT","module":"index.ts","name":"@bun-win32/xinput1_4","peerDependencies":{"typescript":"^5"},"private":false,"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/xinput1_4"},"type":"module","version":"2.0.1","main":"./index.ts","keywords":["bun","ffi","win32","windows","xinput1_4","bindings","typescript","dll"],"sideEffects":false,"engines":{"bun":">=1.1.0"},"scripts":{"example:gamepad-radar":"bun ./example/gamepad-radar.ts","example:controller-audit":"bun ./example/controller-audit.ts"},"_id":"@bun-win32/xinput1_4@2.0.1","_integrity":"sha512-XKPj5A+tGX/dh0AZSPMamCjc/Eow/Jf7wsnpEYfp/B3Ysmb+pcW94abOPT9v6mMpHsrQVHqITYUK2124ee722w==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"f79778e78364c4909c17da6955ee52cd16c0c3bb","dist":{"integrity":"sha512-XKPj5A+tGX/dh0AZSPMamCjc/Eow/Jf7wsnpEYfp/B3Ysmb+pcW94abOPT9v6mMpHsrQVHqITYUK2124ee722w==","shasum":"f79778e78364c4909c17da6955ee52cd16c0c3bb","tarball":"https://registry.npmjs.org/@bun-win32/xinput1_4/-/xinput1_4-2.0.1.tgz","fileCount":6,"unpackedSize":14549,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDRPqTqWNVj9JHU2sDcjRxxNqJTD7PG1lghlI/pdCzSZQIgcRcX4smCyqgQz3JpRSiVCi8TYPgBQWSz7tq9CFflO/A="}]},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"directories":{},"maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/xinput1_4_2.0.1_1782438237370_0.4717248054661063"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-10T20:28:32.618Z","modified":"2026-06-26T01:43:57.627Z","1.0.0":"2026-04-10T20:28:33.176Z","2.0.0":"2026-06-26T01:06:52.360Z","2.0.1":"2026-06-26T01:43:57.507Z"},"bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","homepage":"https://github.com/ObscuritySRL/bun-win32#readme","keywords":["bun","ffi","win32","windows","xinput1_4","bindings","typescript","dll"],"repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/xinput1_4"},"description":"Zero-dependency, zero-overhead Win32 XINPUT1_4 bindings for Bun (FFI) on Windows.","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"readme":"# @bun-win32/xinput1_4\n\nZero-dependency, zero-overhead Win32 XInput 1.4 bindings for [Bun](https://bun.sh) on Windows.\n\n## Overview\n\n`@bun-win32/xinput1_4` exposes the `xinput1_4.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `Xinput1_4`, which lazily binds native symbols on first use. You can optionally preload a subset or all symbols up-front via `Preload()`.\n\nThe bindings are strongly typed for a smooth DX in TypeScript.\n\n## Features\n\n- [Bun](https://bun.sh)-first ergonomics on Windows 10/11.\n- Direct FFI to `xinput1_4.dll` (Xbox controller input, vibration, battery, and audio).\n- In-source docs in `structs/Xinput1_4.ts` with links to Microsoft Docs.\n- Lazy binding on first call; optional eager preload (`Xinput1_4.Preload()`).\n- No wrapper overhead; calls map 1:1 to native APIs.\n- Strongly-typed Win32 aliases (see `types/Xinput1_4.ts`).\n\n## Requirements\n\n- [Bun](https://bun.sh) runtime\n- Windows 10 or later\n\n## Installation\n\n```sh\nbun add @bun-win32/xinput1_4\n```\n\n## Quick Start\n\n```ts\nimport Xinput1_4 from '@bun-win32/xinput1_4';\n\nconst ERROR_SUCCESS = 0;\nconst state = Buffer.alloc(16); // XINPUT_STATE\n\nconst result = Xinput1_4.XInputGetState(0, state.ptr);\n\nif (result === ERROR_SUCCESS) {\n  const buttons = state.readUInt16LE(4);\n  const lx = state.readInt16LE(8);\n  const ly = state.readInt16LE(10);\n  console.log(`Buttons: 0x${buttons.toString(16)}, Left stick: (${lx}, ${ly})`);\n} else {\n  console.log('No controller on slot 0');\n}\n```\n\n> [!NOTE]\n> AI agents: see `AI.md` for the package binding contract and source-navigation guidance. It explains how to use the package without scanning the entire implementation.\n\n## Examples\n\nRun the included examples:\n\n```sh\nbun run example:gamepad-radar\nbun run example:controller-audit\n```\n\n## Notes\n\n- Either rely on lazy binding or call `Xinput1_4.Preload()`.\n- Windows only. Bun runtime required.\n- **SAL types & naming:** nullability is in the **type** — `Optional<T>` (formally optional, SAL `_*opt_`) and `Nullable<T>` (plain `[in]`/`[out]` the docs say can be NULL), the null sentinel derived from `T` (`null` for pointers `LP*`/`P*`, `0n` for handles/by-value addresses); direction is in the **parameter name** — `_out` (`_Out_`), `_in_out` (`_Inout_`), `_In_` bare. See `AI.md` and the repo `AGENTS.md`.\n","readmeFilename":"README.md"}