Display.translateKey
bool translateKey(uint keycode, gdk.types.ModifierType state, int group, out uint keyval, out int effectiveGroup, out int level, out gdk.types.ModifierType consumed)Translates the contents of a [gdk.event_key.EventKey] into a keyval, effective group, and level.
Modifiers that affected the translation and are thus unavailable for application use are returned in consumed_modifiers.
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.
consumed_modifiers gives modifiers that should be masked out from state when comparing this key press to a keyboard shortcut. 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.
This function should rarely be needed, since [gdk.event_key.EventKey] already contains the translated keyval. It is exported for the benefit of virtualized test environments.
Parameters
keycode | a keycode |
state | a modifier state |
group | active keyboard group |
keyval | return location for keyval |
effectiveGroup | return location for effective group |
level | return location for level |
consumed | return location for modifiers that were used to determine the group or level |