-
public void add_virtual_modifiers (ModifierType state)
Adds virtual modifiers (i.e. Super, Hyper and Meta) which correspond to the real modifiers (i.e Mod2,
Mod3, ...) in modifiers. are set in state to their non-virtual counterparts (i.e. Mod2, Mod3,...) and set
the corresponding bits in state.
-
public bool get_caps_lock_state ()
Returns whether the Caps Lock modifer is locked.
-
public Direction get_direction ()
Returns the direction of effective layout of the keymap.
-
public bool get_entries_for_keycode (uint hardware_keycode, out KeymapKey[] keys, out uint[] keyvals, out int n_entries)
Returns the keyvals bound to hardware_keycode. The Nth
KeymapKey in keys is bound to the Nth keyval in keyvals.
Free the returned arrays with g_free. When a keycode is pressed by the user,
the keyval from this list of entries is selected by considering the effective keyboard group and level. See
translate_keyboard_state.
-
public bool get_entries_for_keyval (uint keyval, out KeymapKey[] keys)
Obtains a list of keycode/group/level combinations that will generate keyval. Groups and
levels are two kinds of keyboard mode; in general, the level determines whether the top or bottom symbol on a key is used, and the
group determines whether the left or right symbol is used. On US keyboards, the shift key changes the keyboard level, and there are no
groups. A group switch key might convert a keyboard between Hebrew to English modes, for example.
EventKey contains a group field that indicates the active keyboard group.
The level is computed from the modifier mask. The returned array should be freed with
g_free.
-
public bool have_bidi_layouts ()
Determines if keyboard layouts for both right-to-left and left-to-right languages are in use.
-
public uint lookup_key (KeymapKey key)
Looks up the keyval mapped to a keycode/group/level triplet. If no keyval is bound to key,
returns 0. For normal user input, you want to use
translate_keyboard_state instead of this function, since the effective group/level may not be the same as the current keyboard
state.
-
public bool map_virtual_modifiers (ModifierType state)
Maps the virtual modifiers (i.e. Super, Hyper and Meta) which are set in state to their
non-virtual counterparts (i.e. Mod2, Mod3,...) and set the corresponding bits in state.
-
public bool translate_keyboard_state (uint hardware_keycode, ModifierType state, int group, uint keyval, int effective_group, int level, ModifierType consumed_modifiers)
Translates the contents of a 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. See key-group-explanation 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, EventKey
already contains the translated keyval, so this function isn't as useful as you might think.