Class OverlayMoveInput
java.lang.Object
privbot.ui.overlay.OverlayMoveInput
- All Implemented Interfaces:
AutoCloseable
Feeds the game canvas's mouse into an
OverlayMoveMode while "Move overlay" is on. Attach it
when the mode turns on and close() it when it turns off, so nothing listens the rest of
the time.
- RuneLite (the client is an AWT component): a RuneLite
MouseManagerlistener. Its events are already in game-canvas pixels (stretched mode included), and a consumed press never reaches the game. - Impact, Elorin and SpawnPK (no RuneLite
MouseManagerreceives the canvas's mouse there): anOverlayMoveEventFilterpushed on the AWT event queue forclient.getCanvas(). It drops the canvas's mouse events over a panel (and during a panel drag), so the game never sees them, and feeds them to the mode. Points are scaled from the canvas component's size to the size the overlay paints in, so a stretched canvas hits the right panel.close()pops it.
-
Method Summary
Modifier and TypeMethodDescriptionstatic OverlayMoveInputattach(net.runelite.api.Client client, net.runelite.client.input.MouseManager mouseManager, OverlayMoveMode mode, Supplier<Dimension> overlayViewport) Starts listening, or returns null when there is no mouse source to listen to.booleanTrue when a consumed press is kept from the game (both paths now).voidclose()Stops listening (unregisters the listener or pops the event filter).
-
Method Details
-
attach
public static OverlayMoveInput attach(net.runelite.api.Client client, net.runelite.client.input.MouseManager mouseManager, OverlayMoveMode mode, Supplier<Dimension> overlayViewport) Starts listening, or returns null when there is no mouse source to listen to.- Parameters:
mouseManager- RuneLite's, or null where there is noneoverlayViewport- the size the overlay paints in (for scaling canvas-listener points), may give null
-
blocksGameInput
public boolean blocksGameInput()True when a consumed press is kept from the game (both paths now). -
close
public void close()Stops listening (unregisters the listener or pops the event filter). Safe to call twice.- Specified by:
closein interfaceAutoCloseable
-