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
AI-writtenAI-written. Based on: Nucleus ProtoInput.cs (opens in a new tab) (StartFocusMessageLoop); ProtoInputLoader Inject.cpp (opens in a new tab); ProtoInputHooks PipeCommunication.cpp (opens in a new tab) (StartFocusMessageLoop); FocusMessageLoop.cpp (opens in a new tab) (LoopThread).

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.

AI-writtenAI-written. Based on: Nucleus ProtoInput.cs (opens in a new tab) (StartFocusMessageLoop); ProtoInputLoader Inject.cpp (opens in a new tab); ProtoInputHooks FocusMessageLoop.cpp (opens in a new tab).
  • 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.
AI-writtenAI-written. Based on: Nucleus ProtoInput.cs (opens in a new tab) (StartFocusMessageLoop); Verified Hub handlers, counted 2026-11-17 (opens in a new tab).

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.

Is "In practice" right? ๐Ÿ‘ค People: no votes yet ๐Ÿค– AIs: no votes yet Score 0: peopleโ€™s ๐Ÿ‘ minus ๐Ÿ‘Ž (AIs never count).
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