-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
Support for untranslated key codes #3141
Open
thedmd
wants to merge
3
commits into
ocornut:master
Choose a base branch
from
thedmd:feature/untranslated_key_codes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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
@ocornut If you find a minute please confirm that what I got is an intended behavior. Thanks! |
thedmd
force-pushed
the
feature/untranslated_key_codes
branch
from
April 20, 2020 19:13
eae4f28
to
99c532a
Compare
thedmd
force-pushed
the
feature/untranslated_key_codes
branch
from
November 28, 2020 12:10
99c532a
to
a02300f
Compare
Back to green. |
ocornut
force-pushed
the
master
branch
2 times, most recently
from
August 27, 2021 19:10
0c1e5bd
to
bb6a60b
Compare
thedmd
force-pushed
the
feature/untranslated_key_codes
branch
2 times, most recently
from
December 12, 2021 12:52
9f2d52e
to
35e191a
Compare
Closed
thedmd
force-pushed
the
feature/untranslated_key_codes
branch
from
December 13, 2021 17:41
35e191a
to
72e4a66
Compare
ocornut
force-pushed
the
feature/untranslated_key_codes
branch
from
December 16, 2021 17:09
72e4a66
to
84c6df7
Compare
ocornut
force-pushed
the
feature/untranslated_key_codes
branch
from
December 16, 2021 17:17
84c6df7
to
0cd3f8c
Compare
thedmd
force-pushed
the
feature/untranslated_key_codes
branch
2 times, most recently
from
January 5, 2022 15:17
620285c
to
e604d84
Compare
ocornut
force-pushed
the
feature/untranslated_key_codes
branch
from
January 10, 2022 14:31
e604d84
to
9ca1e27
Compare
Update on this (following our work and conversation with thedmd on e.g. #4858 #2625) TL;DR;
For now we'll let this dangling as there's isn't much immediate use for this, but the branch has now been rebased over latest. |
ocornut
force-pushed
the
master
branch
2 times, most recently
from
January 17, 2022 14:21
b3b85d8
to
0755767
Compare
ocornut
force-pushed
the
master
branch
3 times, most recently
from
February 15, 2022 16:25
c817acb
to
8d39063
Compare
thedmd
force-pushed
the
feature/untranslated_key_codes
branch
from
August 19, 2022 11:18
9ca1e27
to
0e3414c
Compare
Now it dangle at v1.89 (18808) :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add support for untranslated key codes (scancodes) for ImGui.
Intention is to provide forward way for ImGui to handle untranslated keys in response to #2625 (comment).
I introduced
GetUntranslatedKeyIndex
to mapImGuiKey_
intoio.KeyDown
index. Similar to whatGetKeyIndex
does. Difference is scancodes remain the same regardless of keyboard layout used and correspond to physical placement of the keys.Support for untranslated keys is an optional backend feature controlled by new flag:
For backends without support for this feature
GetUntranslatedKeyIndex
behaves exactly likeGetKeyIndex
.PR provide an implementation in
imgui_impl_win32.cpp
backend as an example. More will be done as this idea mature.Things I can think of out of the box that should be discussed:
GetKeyName
be hardcoded, localized and/or system dependent?image source
Maybe most common physical layouts to scancode mapping should be provided? Or one is enough beacause user will be able to pick keys according to default one.
Summing things up:
For French keyboard:
Please let me know what do you think.
Edit:
Demo for French keyboard layout. I tap keys in same order in both cases.