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

Fixes to key binding system #2524

Merged
merged 7 commits into from Jan 5, 2014
Merged

Conversation

johnbartholomew
Copy link
Contributor

For #2523. This makes various changes related to that issue:

  • Key repeat is now identified in KeyboardEvent so that it can be ignored if appropriate.
  • Descriptions of modified keys are now slightly nicer (needs translations to be updated slightly)
  • Modifier keys can be used by key bindings, but cannot themselves have other modifiers applied.
  • Left and Right modifier keys are always treated as equivalent when used as modifiers. When they're used directly as bindings (e.g., binding the Right Shift key to Decrease Set Speed), then they are not equivalent.

I'm not totally sure how we want modifier keys to behave with respect to key bindings. As with so many things, we may have to revisit that in the future.

This means that bindings can only specify a general modifier (CTRL, SHIFT
etc), not a side-specific modifier (LCTRL, RSHIFT etc), and when matching
SDL events, either modifier can be used.
Translation change: modifier key names should no longer have whitespace
included in the translation; they should also be in title case.
i.e., don't allow "Ctrl + Left Alt" as a binding. Modifiers can still
be applied to non-modifier keys (e.g., "Ctrl + T"), and modifier keys
can still be captured as bindings on their own (e.g., "Right Shift").
@johnbartholomew
Copy link
Contributor Author

Rebased to master.

@robn robn merged commit 1ca7836 into pioneerspacesim:master Jan 5, 2014
@shadmar
Copy link
Contributor

shadmar commented Jan 5, 2014

KeyBinding(): type(BINDING_DISABLED), u{{SDLK_UNKNOWN, KMOD_NONE}} {}
fails to compile on msvc

Error 1 error C2059: syntax error : '{'
Error 2 error C2334: unexpected token(s) preceding '{'; skipping apparent function body
Error 3 error C2143: syntax error : missing ';' before '}'

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.

None yet

3 participants