microsoft / node-native-keymap

Provide OS keyboard layout functionality as a nodejs module
MIT License
136 stars 37 forks source link

Adds dead character into keyboard buffer for Czech Programmers layout #4

Closed the-ress closed 8 years ago

the-ress commented 8 years ago

The code adds double acute accent dead character when run with Czech Programmers keyboard layout.

How to reproduce:

  1. Switch to Czech Programmers layout.
  2. Run npm test.
  3. Switch to any other application.
  4. Type a.

Result: ˝a gets typed.

This is very annoying as it happens every time I run VS Code.

the-ress commented 8 years ago

It's caused by ToUnicode for Shift+AltGr+VKEY_OEM_102. It inserts the dead character into the keyboard buffer 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.

alexdima commented 8 years ago

Fixed by PR #5