Share via


Detecting Key Presses

To detect key presses, the Windows CE GetAsyncKeyState function is used in all but the simplest of cases, due to the variety of behaviors exhibited by keyboard drivers available on Pocket PC devices.

Determining the device version and whether there is an external keyboard are common questions for developers, and GAPI helps provide an answer. For example, external keyboards are becoming more common, and having your code check for keyboards can help add functionality to your application for keyboard users.

GAPI includes the GXKeyList structure to provide information about the default hardware button assignments.

Note   On many devices, press and hold of the back key causes the device to lock. If your game monitors for back key press events, it should also be designed to handle back key press and hold events. For more information, see How to: Program a Press-and-Hold Feature.

See Also

Animating Graphics | GAPI Overview | How to: Program a Press-and-Hold Feature

Send feedback on this topic to the authors.

© 2005 Microsoft Corporation. All rights reserved.