Nucleus handler tools โบ Docs โบ ProtoInput โบ StartFocusMessageLoop
ProtoInput.StartFocusMessageLoop
Open in the workbench (search, and try it in a handler)
ProtoInput.StartFocusMessageLoop(
instanceHandle: number,
milliseconds: number,
wm_activate: boolean,
wm_activateapp: boolean,
wm_ncactivate: boolean,
wm_setfocus: boolean,
wm_mouseactivate: boolean
): void
Starts posting focus messages to the game's main window in a loop, so the game believes it is focused. Parameters, in order: the instance handle, the interval in milliseconds, then true/false for WM_ACTIVATE, WM_ACTIVATEAPP, WM_NCACTIVATE, WM_SETFOCUS and WM_MOUSEACTIVATE.
instanceHandle: The player's Proto Input instance, Player.ProtoInputInstanceHandle (or PlayerList[i].ProtoInputInstanceHandle).milliseconds: Pause between rounds of fake focus messages, in milliseconds.wm_activate: true posts WM_ACTIVATE (click-activate) to the game window each round.wm_activateapp: true posts WM_ACTIVATEAPP (activated) to the game window each round.wm_ncactivate: true posts WM_NCACTIVATE (active title bar) to the game window each round.wm_setfocus: true posts WM_SETFOCUS to the game window each round.wm_mouseactivate: true posts WM_MOUSEACTIVATE to the game window each round.
In practice
Starts Proto Input's focus loop for one instance from a callback, instead of Game.ProtoInput.EnableFocusMessageLoop at setup. The arguments are the instance, the milliseconds between rounds, then whether to send WM_ACTIVATE, WM_NCACTIVATE, WM_ACTIVATEAPP, WM_SETFOCUS and WM_MOUSEACTIVATE. Handlers mostly call it in Game.ProtoInput.OnInputLocked, often right after ProtoInput.StopFocusMessageLoop.