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

Use different method to get key label in the no modifiers case #1

Closed
alexdima opened this issue Dec 16, 2015 · 2 comments
Closed

Use different method to get key label in the no modifiers case #1

alexdima opened this issue Dec 16, 2015 · 2 comments

Comments

@alexdima
Copy link
Member

Currently, for German (Swiss) the value for VKEY_OEM_5 is:

  { key_code: 'VKEY_OEM_5',
    value: '´ä',
    withShift: 'à',
    withAltGr: '{',
    withShiftAltGr: '' },

Try to make it ä instead of ´ä

@alexdima
Copy link
Member Author

See microsoft/vscode#1358

@the-ress
Copy link
Contributor

the-ress commented Oct 3, 2016

The issue is actually caused by calling ToUnicode for AltGr+VKEY_OEM_4 before calling it for VKEY_OEM_5. The first call inserts the dead character into the buffer and then the call for VKEY_OEM_5 returns both characters.

As described in ToUnicodeEx documentation:

As ToUnicodeEx translates the virtual-key code, it also changes the state of the kernel-mode keyboard buffer. This state-change affects dead keys, ligatures, alt+numpad key entry, and so on.

The fix in 966f8cf only defers the issue to the next character:

  { key_code: 'VKEY_OEM_5',
    value: 'ä',
    withShift: '´à',
    withAltGr: '{',
    withShiftAltGr: '' },

This issue affects Czech Programmers layout too.

the-ress added a commit to the-ress/node-native-keymap that referenced this issue Oct 3, 2016
alexdima added a commit that referenced this issue Oct 5, 2016
Clear keyboard buffer after ToUnicode call (Fixes #1 and #4)
alexdima added a commit that referenced this issue Oct 5, 2016
… no modifier case for windows"

This reverts commit 966f8cf.
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

No branches or pull requests

2 participants