HandleKeyEvents
HandleKeyEvents(keyEvents)
Posts key events as if they were typed on a hardware keyboard. You can use this function for testing purposes or to play back keyboard macros.
DISCUSSION
- keyEvents
- An array of integers. Each integer specifies a single key-down or key-up event. The least significant seven bits of each integer specify a key code value, and the eighth bit indicates whether or not the event is a key-down event. Add 128 to the key code value to simulate a key-down event.
- return value
- Undefined; do not rely on it.
The state of the hardware keyboard (its keymap) is saved and restored before and after the events are handled so that inconsistencies are avoided (that is, if the Shift key is down on the actual keyboard, it had better be down in the hardware keyboard's
keyMap
).
- Note
- You cannot simulate key-repeat events with the
*HandleKeyEvents
function.![]()
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help