Package net.openosrs.api.input
Class InputScope
- java.lang.Object
-
- net.openosrs.api.input.InputScope
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public final class InputScope extends java.lang.Object implements java.lang.AutoCloseablePins the input mode for the current thread until closed.This is the escape hatch for work the cursor cannot do reliably. A plugin that needs a bank sequence, a rapid offer edit or any interaction with an off-screen target opens a
InputMode.PACKETscope and gets the deterministic path regardless of the user's global setting:try (InputScope scope = InputScope.packets()) { ge.collect(0); }Scopes nest and restore the previous value on close, so a helper that opens its own scope cannot leak its choice back to its caller. Each thread carries its own value; a scope opened on the client thread does not affect work queued elsewhere.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()static InputModecurrent()The mode pinned on this thread, ornullwhen nothing is pinned and the configured default should decide.static InputScopehumanMouse()Force every interaction on this thread through the cursor.static booleanisPinned()static InputScopeof(InputMode mode)static InputScopepackets()Force every interaction on this thread through the native menu pipeline.
-
-
-
Method Detail
-
packets
public static InputScope packets()
Force every interaction on this thread through the native menu pipeline.
-
humanMouse
public static InputScope humanMouse()
Force every interaction on this thread through the cursor.
-
of
public static InputScope of(InputMode mode)
-
current
public static InputMode current()
The mode pinned on this thread, ornullwhen nothing is pinned and the configured default should decide.
-
isPinned
public static boolean isPinned()
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable
-
-