Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Mouse Button Support #974

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

dlamkins
Copy link
Member

@dlamkins dlamkins commented Jul 2, 2024

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 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.

@dlamkins dlamkins added the feature New feature or request label Jul 2, 2024
@dlamkins dlamkins added the WIP This is unfinished code intended for further discussion and should not be merged until it is done. label Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request WIP This is unfinished code intended for further discussion and should not be merged until it is done.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant