Skip to main content

Input Lock

PacketUtilsPlugin owns InputLockService. It blocks game-canvas keyboard, mouse, wheel, and RuneLite menu-click input while active n3 automation plugins request the lock.

PacketUtilsPlugin configuration controls the lock:

  • Block user input during automation defaults to on.
  • Turning it off leaves automation behavior unchanged but allows manual canvas input to reach the game.

Coverage

The lock utilizes RuneLite KeyManager, MouseManager, an AWT listener filtered to client.getCanvas(), VarClientInt.BLOCK_KEYPRESS, and MenuOptionClicked.consume().

It skips OS-level actions, RuneLite side-panel controls, plugin config edits, and client closure. The canvas-filtered AWT listener allows users to interact with the RuneLite UI outside the game canvas.

Ownership

Automation plugins request the lock only while managing active work:

  • Market Alcher while its controller ticks and its active-only Break Handler runs.
  • Tutorial Island while running, not halted, and not manually paused.
  • Guardians of the Rift while its controller runs, omitting wait or pause states.
  • Questing Assistant while enabled.
  • Walk Assistant while owning an active path. (Note: PacketUtilsPlugin owns walker ticking).
  • Mule Orchestrator while the slave workflow processes an active command.
  • Dialogue Helper only while handling a visible continue or Quest Helper option.

PacketUtilsPlugin refreshes the lock from onGameTick. Owners must request again from their active tick path. Stale owners expire after a short game-cycle window, preventing a stopped plugin from holding the lock indefinitely.

Synthetic Input

CanvasInput and KeyboardHelper wrap suite-dispatched AWT events with InputLockBypass.withSyntheticInput(...). This lets n3 automation type, click, move the camera, or dismiss menus while the lock blocks manual user input.

SyntheticMouseService uses the same bypass for move-only preview paths. It requires an opt-in, owns one Swing timer on the EDT, and avoids sleeping or owning a game tick. Manual canvas input, logout, shutdown, canvas resize, or view-mode change cancels the current path. When users enable Use synthetic mouse, supported NPCActions, ObjectActions, and WidgetActions operations execute these paths and complete with a native canvas click instead of a reflection packet dispatch. Developer Tools can run movement-only previews.

Synthetic click dispatch temporarily makes the queued target the forced left-click menu entry, emits move/press/release/click AWT events, and restores the previous menu entries and canvas focusability afterward. The system records action pacing when accepting movement, not when the cursor arrives. A busy mouse, missing clickbox, canvas change, manual input, or failed movement fails closed and avoids falling back to a packet action.

The focusability guard prevents a synthetic click from requesting keyboard focus transfer to the canvas from AWT. It avoids falsifying the game client's focus, window, resize, minimize, or occlusion state. It skips installing injected client or revision-sensitive focus/window packet hooks.

See Synthetic Mouse for configuration, supported actions, failure behavior, and the live-verification boundary.

Validation

Unit tests cover request/release, stale-owner expiry, config disablement, synthetic bypass, key/mouse/wheel/menu consumption, and BLOCK_KEYPRESS refresh.