Last night I pushed a small update to Ashita and to the Addons plugin to expose two new events.
- key
- mouse
These events can be used by addons to handle input from the keyboard and mouse.
Changelog
- Addons: Added key event for keyboard input processing.
- Addons: Added mouse event for mouse input processing.
- Ashita: Changed the order in which mouse events were handled internally so that addons and plugins see the mouse events before the internal handlers such as the font manager.
The key event looks like:
- ashita.register_event('key', function(key, down, blocked)
- return false;
- end);
- key - number - The DirectInput id of the key press.
- down - boolean - The down/up state of the key. (True if down, false if up.)
- blocked - boolean - Flag if another addon has blocked the key press. (True if blocked by another addon.)
The mouse event looks like:
- ashita.register_event('mouse', function(id, x, y, delta, blocked)
- return false;
- end);
- id - number - The windows event id of the mouse event. (See here for notification ids: https://msdn.microsoft.com/en-us/librar ... s.85).aspx)
- x - number - The x axis point of the mouse.
- y - number - The y axis point of the mouse.
- delta - number - The scroll wheel delta of the mouse when scrolling.
- blocked - boolean - Flag if another addon has blocked the mouse event. (True if blocked by another addon.)