To add mouse button support for keybinds without introducing any breaking changes. Support middle-mouse, XButton1, and XButton2.
Implementation:
This PR adds PrimaryMouseButton on keybinds. Assignments to this field are mutually exclusive with the PrimaryKey property. Assigning a value to one clears the other. Support for modifier keys + a mouse button has been added.
Current Issues/TODO:
[ ] BlockSequenceFromGw2 does not work with keybinds using mouse button bindings (it's just ignored). It will require several more changes to the MouseHandler if we want to support that. 😬
[ ] Keyboard state changes are easy to detect, but currently I have it listening to several events to capture the button presses. This should hopefully get simplified so that there aren't 6 events that need listened to.
[ ] Consider the implications of this change for modules that use the keybind to pass inputs to the game. Existing modules won't know about mouse buttons and will (best case) silently fail / do nothing.
[ ] Because MouseButtonActive() checks GameService.Input.State, but is triggered by the mouse events (which will trigger a frame before the state is updated), the keybind will sometimes fail to trigger if the button is pressed for too short of a time.
[ ] This PR includes a few other changes (like to the profile), that shouldn't be left in.
Goal:
To add mouse button support for keybinds without introducing any breaking changes. Support middle-mouse, XButton1, and XButton2.
Implementation:
This PR adds
PrimaryMouseButton
on keybinds. Assignments to this field are mutually exclusive with thePrimaryKey
property. Assigning a value to one clears the other. Support for modifier keys + a mouse button has been added.Current Issues/TODO:
BlockSequenceFromGw2
does not work with keybinds using mouse button bindings (it's just ignored). It will require several more changes to the MouseHandler if we want to support that. 😬MouseButtonActive()
checksGameService.Input.State
, but is triggered by the mouse events (which will trigger a frame before the state is updated), the keybind will sometimes fail to trigger if the button is pressed for too short of a time.