Documentation | InterfaceKit | key_map
DESCRIPTION
Exposes the C++ key_map
struct as a
native map.
FIELDS
version
An integer.
caps_key
scroll_key
num_key
left_shift_key
right_shift_key
left_command_key
right_command_key
left_control_key
right_control_key
left_option_key
right_option_key
menu_key
The key code of the key in question. In theory, you could map any key on the keybaord to the caps lock function. (But this probably would not be a good idea.)
lock_settings
A bitmask which may be 0
or a combination of B_CAPS_LOCK
, B_NUM_LOCK
,
and B_SCROLL_LOCK
. This indicates which locks will be on when the machine
is rebooted.
control_map
option_caps_shift_map
option_caps_map
option_shift_map
option_map
caps_shift_map
caps_map
shift_map
normal_map
Each of these tables is a native list that
maps a key code to the character it produces when the modifiers in question
are on. For example, the A
key has a key code of 0x3c
. So the character at
that index should be a
in normal_map
and A
in shift_map
. You can
specify other characters when other modifiers are on.
Note
In the C++ struct that this is a representation of, the values in these tables are offsets into a chunk of character data. As a convenience, the API bindings provide the characters themselves instead.
acute_dead_key
grave_dead_key
circumflex_dead_key
dieresis_dead_key
tilde_dead_key
Each of these tables is a native list of character pairs; each pair is also a native list. The first character in each pair is the character that would be produced without the dead key; the second character is that character that will be produced with the dead key.
The first pair does double duty: in addition to providing a map from ordinary character to dead key character, the second item of the pair is the dead key character itself. (By convention, the first item is a space.)
Note that despite the names of the tables, the dead key is identified by the first pair, and does not necessarily have to be the key in the table name.
Note
As with the maps above, the C++ struct uses offsets into character data instead of the characters themselves.
acute_tables
grave_tables
circumflex_tables
dieresis_tables
tilde_tables
Each of the values is an index containing a bitmask formed from the Keymap table constants. It indicates which table or tables the dead key pairs are active for.
For example, the value B_NORMAL_TABLE
would indicate that the dead key
table is active when no modifier keys are in effect, and B_OPTION_CAPS_TABLE
indicates that the dead key table is active when the caps lock is on and the
option key is held down.