getkeystate
v1.0.3
Published
Get user keys pressed
Downloads
3
Maintainers
Readme
GetKeyState
its Work in the same way as a GetKeyState() function used by a cpp file.
Installation
Use the package manager npm or yarn to install GetKeyState.
yarn add getkeystate
npm install getkeystate
Usage
const GetKeyState = require("getkeystate");
const Sleep = require("sleepcpp");
/* the params accept virtual key codes. See more in https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes */
while(GetKeyState(0x20) != 1){
//waiting space being pressed
Sleep(200);
}
console.log("space pressed");
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.