Key Codes

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_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.


Previous | Next | Top | Cafe au Lait

Copyright 1997, 1998 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified June 25, 1998