0

I am using 2018.2 community edition, and because I use my customized keyboard layout and all virtual keycodes are changed, I see some curiosity here. (To learn what is virtual keycode, here is the link)

Basically, to comment lines of code, we use Ctrl + /. Note: the / is the character output, not the VK code. The corresponding VK code is OEM_2 in a QWERTY layout. But, when I press the key in my layout with VK_OEM_2, which is the first key of number lines(the one under ESC), nothing happens. There are also other keys which cannot be mapped. It seems the IntelliJ key mapping is related to locations of keys, not to VK codes?

So, how does IntelliJ team handles the keymap configuration? In Windows, in theory all hot keys should be mapped to VK code, not characters. But when you show the mapped key in "keymap" configuration window, you show the characters of the mapped VK key's character.

WesternGun
  • 11,303
  • 6
  • 88
  • 157
  • 1
    It's complicated, see https://youtrack.jetbrains.com/issue/IDEA-165950 and the linked issues. Other Java Swing apps may be also affected. Check with JEdit or NetBeans. It could be JDK limitation. – CrazyCoder Sep 04 '18 at 10:52
  • So, how does Eclipse solves it... I am very curious about where I can see their code base. As far as I know `VK_` is available in Java Swing – WesternGun Sep 04 '18 at 12:25
  • SWT handles key code events differently than Swing. Not aware of the technical details, sorry. – CrazyCoder Sep 04 '18 at 18:15
  • Yes now I remember Eclipse uses SWT. Nah. – WesternGun Sep 04 '18 at 20:31

0 Answers0