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

Added the possibility to switch between spaces and use the shift key to invert behavior #82

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dn0sar
Copy link

@dn0sar dn0sar commented Feb 17, 2024

Thanks for making Sensible Side Buttons open-source! I think it is important to be able to inspect the code of an app that has access and can modify user inputs.

I tend to use the side buttons to swap between macOS spaces rather than back and forth.
Other tools I tried to customize this behavior are either closed source or buggy (Logitech options, Karabiner Elements).

I added this functionality to your app. The default behavior stays the same as before (emulating swap gestures), but now if people want can re-map the mouse side buttons to swap between spaces. I also added the possibility to press the keyboard "shift key" to dynamically change the behavior back to the two-finger swype. The menu looks like this with my PR:

new_menu_sensible_buttons

Anyway, I hope this can be useful to other people as well :)

How it works

The new option for switching spaces works by sending a keyboard event when the mouse side buttons are pressed ("ctrl + arrow right/left"). I tried to also emulate the three-finger gestures to achieve the same, but emulating key presses was easier to implement -- so I went with that.

The "shift" key detection works by monitoring the shift mask flag state of the mouse button event (so the app does not need to monitor for new events).

- Added a new option to use the mouse buttons to switch between spaces instead of only emulating swype gestures
- Added a new option to use the shift key to invert the behavior. If this option is enabled and shift is pressed
  the mouse buttons function switches to either back/forth (swapping with two fingers) or swapping between spaces
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant