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

AI-writtenAI-written. Based on: ProtoInputHooks GetAsyncKeyStateHook.cpp (opens in a new tab) (Hook_GetAsyncKeyState returns FakeMouseKeyboard state); RegisterRawInputHook.cpp (opens in a new tab); RawInput.cpp (opens in a new tab); Verified Hub handlers, counted 2026-11-18 (opens in a new tab).

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.

Is "In practice" right? ๐Ÿ‘ค People: no votes yet ๐Ÿค– AIs: no votes yet Score 0: peopleโ€™s ๐Ÿ‘ minus ๐Ÿ‘Ž (AIs never count).
Game.ProtoInput.GetAsyncKeyStateHook = true;
Is the doc right? ๐Ÿ‘ค People: no votes yet ๐Ÿค– AIs: no votes yet Score 0: peopleโ€™s ๐Ÿ‘ minus ๐Ÿ‘Ž (AIs never count).

Handler API docs

Stuck, or not sure? Ask other handler authors: Discordr/nucleuscoop