{"_id":"@bun-win32/xinput9_1_0","_rev":"3-3cda8d28e86a193c45e0aea07be14731","name":"@bun-win32/xinput9_1_0","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@bun-win32/xinput9_1_0","version":"1.0.0","keywords":["bun","ffi","win32","windows","xinput9_1_0","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/xinput9_1_0@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":"b22777d8db6c35ee16a6eadf45eadada86629de4","tarball":"https://registry.npmjs.org/@bun-win32/xinput9_1_0/-/xinput9_1_0-1.0.0.tgz","fileCount":6,"integrity":"sha512-F7y5G8b4Fj3k3ClwZGzn205gmgIg59WzEVXZjoSM0nVnBXnoekBMU/3PLC5+BplkYGbrPwx2wynpgz9XcpB9Hw==","signatures":[{"sig":"MEYCIQD9jcIvlym4RTb0CWNNK+QTSO53Po6D0084Tba0LyjIcAIhANHQkjEZcJJiNWMCdorDKcmg+kYVuecqNaXPIalA2/WO","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9914},"main":"./index.ts","type":"module","module":"index.ts","shasum":"b22777d8db6c35ee16a6eadf45eadada86629de4","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:gamepad-monitor":"bun ./example/gamepad-monitor.ts","example:controller-report":"bun ./example/controller-report.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-F7y5G8b4Fj3k3ClwZGzn205gmgIg59WzEVXZjoSM0nVnBXnoekBMU/3PLC5+BplkYGbrPwx2wynpgz9XcpB9Hw==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/xinput9_1_0"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 XINPUT9_1_0 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/xinput9_1_0_1.0.0_1775852919099_0.4376439269252568","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@bun-win32/xinput9_1_0","version":"2.0.0","keywords":["bun","ffi","win32","windows","xinput9_1_0","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/xinput9_1_0@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":"ffa7daf97d017269e598e48179d788b3b74bfa03","tarball":"https://registry.npmjs.org/@bun-win32/xinput9_1_0/-/xinput9_1_0-2.0.0.tgz","fileCount":6,"integrity":"sha512-dGJNXoPfEBg5cKNnHtw5kMLkuveP3mUyJyPQ4Wl8PCVYoRPIRslgR18yk6ov2pW1ugsLKHMT+n9s3P5EjvhBgw==","signatures":[{"sig":"MEYCIQCY2+GWaWkeJtgs2J2iAaSDfI4UJ9spLU/DUS1K32iBhwIhALNP0yo8B05zhQhV6hZqdMqgmaM4RVO3Q5199Ju6NVTf","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11191},"main":"./index.ts","type":"module","module":"index.ts","shasum":"ffa7daf97d017269e598e48179d788b3b74bfa03","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:gamepad-monitor":"bun ./example/gamepad-monitor.ts","example:controller-report":"bun ./example/controller-report.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"_integrity":"sha512-dGJNXoPfEBg5cKNnHtw5kMLkuveP3mUyJyPQ4Wl8PCVYoRPIRslgR18yk6ov2pW1ugsLKHMT+n9s3P5EjvhBgw==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/xinput9_1_0"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 XINPUT9_1_0 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/xinput9_1_0_2.0.0_1782436013775_0.21054195076848337","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 XINPUT9_1_0 bindings for Bun (FFI) on Windows.","devDependencies":{"@types/bun":"latest"},"exports":{".":"./index.ts"},"license":"MIT","module":"index.ts","name":"@bun-win32/xinput9_1_0","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/xinput9_1_0"},"type":"module","version":"2.0.1","main":"./index.ts","keywords":["bun","ffi","win32","windows","xinput9_1_0","bindings","typescript","dll"],"sideEffects":false,"engines":{"bun":">=1.1.0"},"scripts":{"example:gamepad-monitor":"bun ./example/gamepad-monitor.ts","example:controller-report":"bun ./example/controller-report.ts"},"_id":"@bun-win32/xinput9_1_0@2.0.1","_integrity":"sha512-S9yQKt29zmH4KRi7ah7S47jywE+2sCfK7FzYdBoioVX98KWThg4jBwB/BRKjGmdmHlgCNROT+yv+3zL4zV63Ow==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"7488f9961bdcd439cb6895e297006dc342cdb810","dist":{"integrity":"sha512-S9yQKt29zmH4KRi7ah7S47jywE+2sCfK7FzYdBoioVX98KWThg4jBwB/BRKjGmdmHlgCNROT+yv+3zL4zV63Ow==","shasum":"7488f9961bdcd439cb6895e297006dc342cdb810","tarball":"https://registry.npmjs.org/@bun-win32/xinput9_1_0/-/xinput9_1_0-2.0.1.tgz","fileCount":6,"unpackedSize":11191,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD3x6/hwTz7F4Na3iDGYxLR2yiaPrfk7o5y6UWNBcpXLwIhAOiu+nFc8uGUqNJ7MV8fdyK5+o0ZrLEXtrWv8hnfFJnw"}]},"_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/xinput9_1_0_2.0.1_1782438239178_0.43656128883856016"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-10T20:28:39.036Z","modified":"2026-06-26T01:43:59.464Z","1.0.0":"2026-04-10T20:28:39.253Z","2.0.0":"2026-06-26T01:06:53.922Z","2.0.1":"2026-06-26T01:43:59.347Z"},"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","xinput9_1_0","bindings","typescript","dll"],"repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/xinput9_1_0"},"description":"Zero-dependency, zero-overhead Win32 XINPUT9_1_0 bindings for Bun (FFI) on Windows.","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"readme":"# @bun-win32/xinput9_1_0\n\nZero-dependency, zero-overhead Win32 XInput 9.1.0 bindings for [Bun](https://bun.sh) on Windows.\n\n## Overview\n\n`@bun-win32/xinput9_1_0` exposes the `xinput9_1_0.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `Xinput9_1_0`, 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 `xinput9_1_0.dll` (legacy Xbox controller input and vibration).\n- In-source docs in `structs/Xinput9_1_0.ts` with links to Microsoft Docs.\n- Lazy binding on first call; optional eager preload (`Xinput9_1_0.Preload()`).\n- No wrapper overhead; calls map 1:1 to native APIs.\n- Strongly-typed Win32 aliases (see `types/Xinput9_1_0.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/xinput9_1_0\n```\n\n## Quick Start\n\n```ts\nimport Xinput9_1_0 from '@bun-win32/xinput9_1_0';\n\nconst ERROR_SUCCESS = 0;\nconst state = Buffer.alloc(16); // XINPUT_STATE\n\nconst result = Xinput9_1_0.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-monitor\nbun run example:controller-report\n```\n\n## Notes\n\n- Either rely on lazy binding or call `Xinput9_1_0.Preload()`.\n- Windows only. Bun runtime required.\n- For new projects, prefer `@bun-win32/xinput1_4` which provides additional APIs (battery, keystroke, audio device IDs).\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"}