-
-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
[Feature] Swap buttons on PS2 Mouse/Trackball #9205
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a fan of the new proposed logic. Its far more complex than just swapping two bits. I dont have time to profile it, but i cant imagine its much faster/smaller.
Yes I tried to found a simple solution but I cant see it. I'm not a fan of complexity too.
This code doesn't work as intented. Just works with 2 buttons mouses partially. With 3 buttons: If you try to implement the 4th and 5th button of MS Intellimouse Explorer this mess up the Z3, Z1 & Z0.
I think the most performant and simple solution is a look up table. Something like:
|
I changed the logic to a LUT. |
However the lookup table still suffers from assumptions in the value of |
I return to the idea of operators. I tried to think another approach. |
Also, (@noroadsleft ) I think this should be retargeted to the develop branch, and rebased. |
1d4c0cd
to
65c27a3
Compare
a1b96ba
to
3430907
Compare
Co-authored-by: Nick Brassel <[email protected]>
* [Feature Request] Swap buttons on PS2 Mouse/Trackball * [Feature Request] Swap buttons on PS2 Mouse/Trackball * Added id: to the doc * Missing space * Solve comment qmk#9205 (comment) * Solve comments qmk#9205 (comment) & qmk#9205 (comment) * Format code more according to https://docs.qmk.fm/#/coding_conventions_c * change logic to LUT * WIP: Clean up * WIP: Solution with xor operators to mask the change * delete #endif & added the missed xor operator (ahhh) * Variable (mouse_report->buttons): avoid setting twice qmk#9205 (comment) * Update tmk_core/protocol/ps2_mouse.c Co-authored-by: Nick Brassel <[email protected]> Co-authored-by: juank <[email protected]> Co-authored-by: Nick Brassel <[email protected]>
* [Feature Request] Swap buttons on PS2 Mouse/Trackball * [Feature Request] Swap buttons on PS2 Mouse/Trackball * Added id: to the doc * Missing space * Solve comment qmk#9205 (comment) * Solve comments qmk#9205 (comment) & qmk#9205 (comment) * Format code more according to https://docs.qmk.fm/#/coding_conventions_c * change logic to LUT * WIP: Clean up * WIP: Solution with xor operators to mask the change * delete #endif & added the missed xor operator (ahhh) * Variable (mouse_report->buttons): avoid setting twice qmk#9205 (comment) * Update tmk_core/protocol/ps2_mouse.c Co-authored-by: Nick Brassel <[email protected]> Co-authored-by: juank <[email protected]> Co-authored-by: Nick Brassel <[email protected]>
Description
This add the config parameter PS2_MOUSE_INVERT_BUTTONS that invert the left & right button on the PS2 mouse.
Types of Changes
Issues Fixed or Closed by This PR
Checklist