-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[ui] Properly render control character in keybindings list #54350
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
astyled
astyled PR, label is assigned by github actions
json-styled
JSON lint passed, label assigned by github actions
labels
Jan 13, 2022
mqrause
reviewed
Jan 13, 2022
Qrox
reviewed
Jan 13, 2022
src/input.cpp
Outdated
for( char c = 'A'; c <= 'Z'; c++ ) { | ||
add_keyboard_char_keycode_pair( c - 64, string_format( "CTRL+%s", c ) ); | ||
} | ||
|
||
// function keys, as defined by ncurses | ||
for( int i = F_KEY_NUM_BEG; i <= F_KEY_NUM_END; i++ ) { | ||
// not marked for translation here, but specially handled in get_keyname so |
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.
The same should be done for control characters.
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 think this should be fixed; lmk if I messed something up
github-actions
bot
added
the
BasicBuildPassed
This PR builds correctly, label assigned by github actions
label
Jan 13, 2022
You don't know how much I appreciate this. |
Maleclypse
added
Controls / Input
Keyboard, mouse, keybindings, input UI, etc.
[C++]
Changes (can be) made in C++. Previously named `Code`
labels
Jan 14, 2022
J-Fields
force-pushed
the
ctrl-key-name
branch
2 times, most recently
from
January 15, 2022 04:37
52a2caa
to
253c654
Compare
J-Fields
force-pushed
the
ctrl-key-name
branch
from
January 15, 2022 04:38
253c654
to
79a6eae
Compare
J-Fields
changed the title
[ui] Properly render control characters
[ui] Properly render control character in keybindings list
Jan 15, 2022
^A
through ^Z
in keybindings list
13 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
astyled
astyled PR, label is assigned by github actions
BasicBuildPassed
This PR builds correctly, label assigned by github actions
[C++]
Changes (can be) made in C++. Previously named `Code`
Controls / Input
Keyboard, mouse, keybindings, input UI, etc.
json-styled
JSON lint passed, label assigned by github actions
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Interface "Give names to keys that use CTRL in keybindings list"
Purpose of change
You can currently map control characters, but they display as
unknown key <code>
.Describe the solution
Add display names for them to the map
input_manager::get_keyname()
referencesDescribe alternatives you've considered
Mapping more control characters... I think they're all portable, but I'm never sure about this stuff, so if you're reading this and know, lmk.Testing
Checked that they rendered properly:
Additional context