Input Handler

by Kaiochao
An standard handler for tracking a client's macros and mouse. [More]
To download this library for your Linux/Mac installation, enter this on your command line:

DreamDownload byond://Kaiochao.InputHandler##version=6

Emulator users, in the BYOND pager go to File | Open Location and enter this URL:

byond://Kaiochao.InputHandler##version=6

101 downloads
Version 6
Date added: Jul 20 2016
Last updated: Aug 11 2016
2 fans
This library is designed to work with minimal setup by offering various callbacks and (optionally) initializing automatically.

This library makes client implement the InputHandler interface.

InputHandler methods:
* IsButtonPressed(Button) - "Is a certain button pressed?"
* GetAxisValues(Axis) - "Where are the gamepad analog sticks?"
* GetMouseScreenPosition() - "Where is the mouse relative to the camera?"
* GetMouseMapPosition() - "Where is the mouse relative to the world?"
* GetModifierMask() - "What modifier keys are currently being held?"

InputHandler events:
You can use EVENT_ADD(InputHandler.[some event], Object, Callback) so that when [some event] is fired, Object.Callback(...) is automatically called with the same arguments.
You can also override these events to add functionality to input handlers. Call ..() when you want to notify event listeners.
* ButtonPressed(InputHandler, Button)
* ButtonReleased(InputHandler, Button)
* AxisChanged(InputHandler, Axis, X, Y)
* MouseScrolled(InputHandler, DeltaX, DeltaY, Modifiers)
* MouseMoved(InputHandler, MoveX, MoveY)

Required libraries:
* Kaiochao.Directions
* Kaiochao.Enum
* Kaiochao.Event

Gamepad detection requires BYOND 511.