Documentation
[SDK Documentation] [CGapiInput]

 

GapiDraw Classes CGapiSurface CGapiRGBASurface CGapiDraw CGapiDisplay CGapiMaskSurface CGapiBitmapFont CGapiCursor CGapiApplication CGapiInput CGapiVFS CGapiTimer CGapiGradient

CGapiInput

Overview

GapiInput locks all hardware keys on Windows CE and maps up/down/left/right to the correct display orientation.

This document has been updated for use with GapiDraw 4.0 or later.
Last updated on October 5, 2008.

 

CGapInput::OpenInput

Enables a full, exclusive lock of all hardware keys on Windows CE. This is automatically done in the constructor.

HRESULT OpenInput();

Parameters

None

Return values

If this method succeeds, the return value is GD_OK.

If the method fails, the return value may be one of the following return values:

GDERR_LOCKEDKEYS
GDERR_NOGAPI

Remarks

When destroying the CGapiInput object, the keyboard lock will be released automatically.

CGapiInput will try to use the library "gx.dll" to lock the keys of the mobile device. This is the preferred method of locking all the keys on Windows Mobile devices. For CGapiInput to find the file "gx.dll" it needs to be placed in the \Windows folder or the application folder of your program. If the file gx.dll should not be available CGapiDisplay::OpenDisplay will return GDERR_NOGAPI, but you will still be able to use CGapiInput for mapping the directional keys.


CGapInput::CloseInput

Releases the exclusive lock on all hardware keys. This is automatically done in the destructor.

HRESULT CloseInput();

Parameters

None

Return values

If this method succeeds, the return value is GD_OK.

If the method fails, the return value may be one of the following return values:

GDERR_NOTLOCKED


CGapInput::GetKeyList

Returns a list of virtual key codes matching the current display orientation.

HRESULT GetKeyList(GDKEYLIST* pKeyList);

Parameters
pKeyList
Address of a GDKEYLIST structure that will be filled with virtual key codes.
Return values

If this method succeeds, the return value is GD_OK.

If the method fails, the return value may be one of the following return values:

GDERR_INVALIDPARAMS
GDERR_NOTLOCKED

Remarks

The list of virtual key codes contains values for three of the hardware buttons, the start menu button and the arrow keys on Pocket PCs. The orientation of the arrow keys (up/down/left/right) will be adjusted to match the display orientation. Up will for example always be -Y.