Not all keyboards are created alike. Macs have Command and Option keys. PCs have Alt keys. Some PCs have a Windows key. Some don't. Some keyboards have numeric keypads, but many don't. Emacs expects there to be a Meta key which I for one have never actually seen on any keyboard in existence. This key is often mapped to the Escape key, which is again a key some keyboards don't have. Keyboard inconsistency is one of the problems a cross-platform environment has to deal with.
The KeyEvent
class defines a little more than one
hundred virtual key codes that map to different, common, keyboard
keys. KeyEvent.VK_0
through KeyEvent.VK_9
are the same as ASCII '0' through '9' (0x30 - 0x39)
KeyEvent.VK_0
KeyEvent.VK_1
KeyEvent.VK_2
KeyEvent.VK_3
KeyEvent.VK_4
KeyEvent.VK_5
KeyEvent.VK_6
KeyEvent.VK_7
KeyEvent.VK_8
KeyEvent.VK_9
KeyEvent.VK_A
through KeyEvent.VK_Z
are the
same as ASCII 'A' through 'Z'; that is, KeyEvent.VK_A
,
KeyEvent.VK_B
, KeyEvent.VK_C
,
KeyEvent.VK_D
, KeyEvent.VK_E
,
KeyEvent.VK_F
, and so on.