-
Notifications
You must be signed in to change notification settings - Fork 547
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
CLI port: Allow to map NDS keys to joystick buttons. #822
base: master
Are you sure you want to change the base?
Conversation
case SDL_JOYBUTTONUP: | ||
key_code = ((event->jbutton.which & 15) << 12) | JOY_BUTTON << 8 | (event->jbutton.button & 255); | ||
key = lookup_joy_key( key_code ); | ||
if (key == 0x2000) |
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.
what's that magic constant ?
@@ -427,7 +427,7 @@ int main(int argc, char ** argv) { | |||
slot2_device_type = NDS_SLOT2_NONE; | |||
break; | |||
} | |||
|
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.
likewise, etc
I fixed whitespace issues, and added a comment about the magic number in ctrlssdl.cpp. |
I missed one whitespace, all should be fixed now. |
Fixing a pointless whitespace commit with another commit defeats the purpose, unless the PR is squashed. The right way to do this would be to rebuild the patch as a single commit. It's a good exercise for the future if you do that with git tools (soft reset to master on the commit prior to your work, then commit the current differences as a new commit) because it's helpful for cleaning up more severe changes, but you get the same result if you clone the repo again and paste your working copy on top and create a new commit. In either case once done you would have to force push it to the PR branch. |
Also process config file correctly even when errors are found. Previously, mapping a NDS button to a joysticks buttons had to be sequencially, I. e. A, then B, then Select, etc. If any key was skipped in the corresponding order desmume would stop from mapping the keys.
7c92ad8
to
9e872d4
Compare
Fixed, I just rebased the branch on master and squashed the last two commits (the ones about whitespace). |
It allows to map NDS key to joystick buttons. Keys were mapped and
then restored with load_default_config(), thus I remove it, however,
looks like gtk frontends have a different keycode for joystick
buttons, thus a user of both frontends will have to rewrite the
config each time it uses one frontend or the other.
it fixes config file processing, it now continues even when
errors are found. Previously, mapping a NDS button to a joysticks
buttons had to be sequencially, I. e. A, then B, then Select, etc. If
any key was skipped in the corresponding order desmume would stop from
mapping the keys.
Add boost support for joysticks, currently it works in a hold
fashion, I do not know if it should be changed to toggle, or
both. Additionally, I implemented this in a very cheap way, I did not want
to make big chances in the codebase, nonetheless, I could try to fix it in other
way if you do not like it.