Title Banner

Previous Book Contents Book Index Next

Newton Developer Technical Information: Newton Programmer's Guide: 2.1 OS Addendum /
Chapter 4 - Keyboard Enhancements / Keyboard Reference
Methods and Functions for Handling Keystrokes /


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.

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.

DISCUSSION

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.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
26 APR 1997



Navigation graphic, see text links

Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help