-
-
Notifications
You must be signed in to change notification settings - Fork 172
Add mouse button mapping community patch #3078
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
Conversation
This matches the keyboard handling which also uses an enum names for each button. This a pre-requisite to integrate the mouse button mapper patch, which uses magic integers instead of named buttons.
5adb49f
to
4817e52
Compare
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.
I have no remarks. Change looks straightforward an low risk.
Pinging @Burrito78 as our quality assurance person. |
Authors notes: While trying to play The Settlers under DOSBox, I discovered that this game requires something the manual calls a "special click": click the left mouse button while holding down the right mouse button. It turns out that it's impossible to perform this on a MacBook trackpad. Thus I came up with this patch, which lets you map keys to mouse buttons. Now I can use a key on the keyboard as the right mouse button, and use the trackpad for the left mouse button. Imported-from: https://sourceforge.net/p/dosbox/patches/264/
- Sets final and override qualifiers on the event class - Uses a private and constant button identifier, as it can only be set at construction time. - Deletes the default constructor - Uses the MouseButtonId enum names instead of raw integers
4817e52
to
6efcb95
Compare
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.
Thanks for clearing up the many mouse variable. I know it was kind of a nit-picky thing but it reads clearly now. This all looks good to me 👍
Too late, but will check this out in main tomorrow! |
Noice, @kcgen bravely poking the mapper-bear 🐻 ⚔️ 😆 Happy for others to make small changes to it... as long as it's not me 😎 This seems to be a handy set of features, maybe not even the WinUAE mapper implements such things (my gold standard mapper implementation), so one more thing for the Mapper V2.0 feature list 🚀 |
The trick is to use a massive C++ object-oriented incoheritance tree combined with unmanaged pointers. |
Sorry, how do you Map the scrollwheel? I want to map the Scrollwheel Up / Down to correspond the the Pgup/Down keyevent - that means if i scroll up it should emulate the pgup key event. |
It's not possible; host-side mouse events aren't mappable to DOS-side keyboard events. (note the wording in this PR's description: "host-side keyboard and joystick events to create DOS-side mouse-button click, hold, and release events.") |
Description
Adds the mouse buttons to the mapper using @legoscia's community patch. Thanks @legoscia!
This let's users map host-side keyboard and joystick events to create DOS-side mouse-button click, hold, and release events.
It's handy for users on mono-click touch-pads or using mono-button mice , like the ChesterMouse:
This is the last of the features to be integrated from DOSBox ECE's patch set.
Notes to reviewers
Suggest reviewing commit-by-commit.
The first commit replaces our literal integer mouse buttons with a named enum as a prerequisite, because I didn't want to use the patch's magic literals. @FeralChild64 : hoping you can review this commit, specifically.
As for the patch itself: it's just a couple tiny additions to the mapper and follows the existing mapper structure perfectly.
Related issues
Fixes #3073
Manual testing
Tested the baseline PS/2 and serial mouse types.
Tested mapping host keyboard events to mouse buttons.
Tested in games and windows 3.1.
Tested:
Checklist
I have: