GetDefaultKey
Gets the default definition for a key.
Syntax
KBDTools_API HRESULT GetDefaultKey(
BYTE plane,
BYTE page,
BYTE usage,
BYTE* keyType,
BYTE* keyAttribute,
BYTE* keyModifier,
BYTE* value
);
Parameters
plane
Indicates the plane (Normal, Orange, or Green) whose key definition is being referenced.
page
Page value needed to uniquely identify the key.
usage
Usage value needed to uniquely identify the key.
keyType
Determines the primary function for the key:
- NormalKey - Indicates that the value parameter will be a scan code or VKEY value depending on the VKEY bit of the keyAttribute.
- PlaneShift - Key selects the key plane, such as Orange or Green.
- NamedEvent - Key triggers a predefined named event.
- Multikey - Key triggers a predefined key macro.
- Modifier - Key acts as a modifier key (such as Shift, Control, and so on).
- AppLaunch - Key acts as a Microsoft Shell Application Launch Key.
- DLLFunc - Key triggers one of several predefined keyboard driver functions. Not supported on all devices.
- Rotate - Key selects one of several predefined values, such as ABC on a cell phone "2" key.
- Unicode - Key triggers one of several predefined Unicode values. Not supported on all devices.
keyAttribute
Modifies operation of the key:
- NoAttrib - No changes to the key.
- Extended - Key value is preceded by the extended 0xE0 byte. Valid only if keyType is NormalKey.
- NoRepeat - Key will not auto-repeat.
- Silent - Key press does not produce a key click.
- VKEY - Value parameter represents a VKEY value instead of a scan code. Valid only if keyType is NormalKey.
- NOOP - Disables the key.
- Shifted - Key is preceded by a left shift key before its value is sent. Valid only if keyType is NormalKey.
- NoChord - Multikeys are not chorded when sent. Valid only if keyType is Multikey.
keyModifier
Controls the "stickiness" of the key and the LED use. May be:
- NoModifier
- StickyOnce - Key stays pressed until next press of any key. Intended for modifier or PlaneShift keys such as Shift, Orange, and so on.
- StickyPersist - Key stays pressed until next press of same key. Intended for modifier or PlaneShift keys.
- StickyLock - Key pressed twice in a row stays pressed until next key press of same key. Intended for modifier or PlaneShift keys.
- LED1
- LED2
- LED3
value
Actual value of the key. Depends on keyType and keyAttribute values.
Return Values
S_OK
The function succeeded.
Other
The function failed. Use the Microsoft errlook.exe utility to determine the meaning of this value.
Remarks
For the keyAttribute parameter, use NoAttrib, or 0 or more of any other value can be OR'ed together to form a value. Not all combinations are allowed for each of keyType.
For keyModifier, use NoModifier, or 0 or 1 of StickyOnce, StickyPersist, or StickyLock can be OR'ed with 0 or more of LED1, LED2, or LED3 to form a value.
On return, if all parameters except plane, page, and usage are 0, it usually means there was no previous definition for that key to be returned, or it may mean that the key was defined with all other fields 0.
More Information
KBDTools Functions