Search code examples
javamacoskeystroke

Keystroke for cmd-? on OS X? (Java)


I'm desperately searching for the keystroke to access a help menu from my Java application. The command for that is cmd-?, but I've got no idea how to access that.

The keystroke for cmd-c is defined by KeyEvent.VK_C, but unfortunately VK_? does not work. ;)

I've searched the web up and down and couldn't find the right code. Has anybody here the right keystroke?


Solution

  • That's because it's KeyEvent.VK_SLASH with a modifier for shift.

    Personally, I think it's a blunder (on Java's part) to map things like that, since it assumes that my keyboard has '?' as a shifted '/'.