Keymap.translateKeyboardState

Translates the contents of a GdkEventKey into a keyval, effective group, and level. Modifiers that affected the translation and are thus unavailable for application use are returned in consumed_modifiers. See the section called “Description” for an explanation of groups and levels. The effective_group is the group that was actually used for the translation; some keys such as Enter are not affected by the active keyboard group. The level is derived from state. For convenience, GdkEventKey already contains the translated keyval, so this function isn't as useful as you might think. Note consumed_modifiers gives modifiers that should be masked out from state when comparing this key press to a hot key. For instance, on a US keyboard, the plus symbol is shifted, so when comparing a key press to a <Control>plus accelerator <Shift> should be masked out. An older interpretation consumed_modifiers was that it contained all modifiers that might affect the translation of the key; this allowed accelerators to be stored with irrelevant consumed

class Keymap
int
translateKeyboardState

Parameters

hardwareKeycode uint

a keycode

state GdkModifierType

a modifier state

group int

active keyboard group

keyval uint

return location for keyval, or NULL. out[allow-none]

effectiveGroup int

return location for effective group, or NULL. out[allow-none]

level int

return location for level, or NULL. out[allow-none]

consumedModifiers GdkModifierType

return location for modifiers that were used to determine the group or level, or NULL. out[allow-none]

Return Value

Type: int

TRUE if there was a keyval bound to the keycode/state/group

Meta