Javascript Key Codes For Mac
Determining which key is pressed Getting a knee-jerk reaction from the keyboard/script is fun and all, but definitely not practical by itself. What we need is to take the idea further, and learn how to detect when a particular key is pressed. The key is to probe the ' event' object in NS6/Firefox, which contains essential information about an event when it occurs, in this case, the keyboard related events.
Keyboard related properties of the Event object Properties Description altKey, ctrlKey, shiftKey Boolean properties that indicate whether the Alt, Ctrl, Meta, and Shift keys were pressed at time of the event. MetaKey Boolean property that indicate whether the Meta key was pressed at the time of the event. NS/Firefox only.
CharCode Property indicating the Unicode for the key pressed. Use String.fromCharCode(charCode) to convert code to string. NS/Firefox only. Keycode Property indicating the Unicode for the key pressed.
Use String.fromCharCode(keyCode) to convert code to string. Type A string indicating the type of event, such as 'mouseover', 'click', etc.
Which Legacy property indicating the Unicode for the key pressed. Identical to 'charCode', except this property works in NS4 as well. NS/Firefox only.
Javascript Key Code For Mac

Javascript Mac Address
Green properties- NS/ Firefox exclusive. As you can see, some properties of the Event object for the keyboard are shared (those that are white), while others are exclusive to either Firefox.
However, they all serve the same function. You're probably still confused at this point, but nothing a few examples can't help clear up. In the first example, I'll detect and alert the Unicode of any key pressed.