Nucleus handler tools โบ Docs โบ Game.ProtoInput โบ GetAsyncKeyStateHook
Game.ProtoInput.GetAsyncKeyStateHook
Open in the workbench (search, and try it in a handler)
Game.ProtoInput.GetAsyncKeyStateHook: boolean
Similar to Get Key State. Async also tells the caller whether the key was pressed since the last call, so this can resolve issues where keys are pressed or release when they shouldn't. Should almost always be enabled.
Category: Proto Input
In practice
Answers the game's GetAsyncKeyState with the player's own keys, kept by Proto Input from the raw input of the keyboard and mouse picked in Nucleus. That state is only filled while Game.ProtoInput.RegisterRawInputHook is on; without it the game sees no key pressed at all. Key hooks are used as a set: most Proto Input handlers turn on all three, often from OnInputLocked, and nearly always with the raw input hook.
Game.ProtoInput.GetAsyncKeyStateHook = true;