KBDTranslateHidCode

C Specification

#include <revolution/kbd.h>
KBDUnicode KBDTranslateHidCode(KBDHIDCode hid, KBDModState modState, KBDCountryCode co);

Arguments

hid USB HID code to translate.
modState Keyboard modifier state value to use in the translation.
co Country code of the map to be used.

Return Values

KBDUnicode Returns a Unicode value that represents the translated key.
Will return KBK_Error under the following conditions:
  • Keyboard library is not initialized
  • Country code co is invalid
  • HID code hid represents an error code, not a key
Returns KBK_Void if the key has no defined translation.
(For example, if KBD_MS_ALTGR is set but the map has no AltGr.))

Description

Given a USB HID code, modifier state, and country code, this function will return the KBDUnicode value from the appropriate keyboard map.

Note that a KBDUnicode value may be private to the KBD library. All keys are provided with a KBDUnicode value. For the function keys, editing keys, arrow keys, and other special keys, custom (private) Unicode values are used. These private Unicode values are all in the 0xf000-0xf1ff range and should never be used for external data exchange. They should also not be confused with private Unicode values that may be used elsewhere in the Revolution SDK or other SDKs. KBD private Unicode values should only be used with keyboard-related functions.

Please refer to the Introduction for more information about KBDUnicode.

If the modifier state KBD_MS_SHIFTED_KEY is not set, the translate function will ignore KBD_MS_SHIFT, KBD_MS_CAPS_LOCK, and KBD_MS_NUM_LOCK if one or more of these modifiers is also on:

The modifier state KBD_MS_SHIFTED_KEY is off by default.

See Also

Keyboard Functions, Introduction

Revision History

2007/03/27 Initial version.