KBDTranslateHidCode

Syntax

#include <cafe/kbd.h>

KBDUnicode KBDTranslateHidCode(KBDHIDCode hid, KBDModState modState, KBDCountryCode co);

Parameters

hid USB HID code to be translated.
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. It 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.

A KBDUnicode value may be private to the KBD library. All keys are provided with a KBDUnicode value. For the function, editing, arrow, and other special keys, custom (private) Unicode values are used. These private Unicode values are all in the range of 0xf000-0xf1ff; they 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. The KBD private Unicode values should only be used with keyboard-related functions.

For more information about KBDUnicode, refer to the KBD Library Overview : KBDUnicode Values.

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 the following modifiers are also on:

The KBD_MS_SHIFTED_KEY modifier state is off by default.

Do Not Call From

Background Do not call this function from the background.

See Also

KBD Library Overview : Introduction

Revision History

2013/05/08 Automated cleanup pass.
2011/12/21 Moved to Cafe.
2007/03/27 Initial version.


CONFIDENTIAL