GObject.Object
Gdk.Keymap
Import line: | Gdk = imports.gi.Gdk; |
GIR File: | Gdk-3.0.gir |
C documentation: | GdkKeymap |
Class : | Keymap |
Extends: | GObject.Object |
None |
Method / Constructor | Defined By | |
---|---|---|
new Gdk.Keymap
()
Create a new Gdk.Keymap
Create a new Gdk.Keymap
|
||
Gdk.Keymap.get_default
()
:
Gdk.Keymap
Returns the GdkKeymap attached to the default display.
Returns the GdkKeymap attached to the default display.
|
Gdk.Keymap | |
Returns the GdkKeymap attached to display.
Returns the GdkKeymap attached to display.
|
Gdk.Keymap | |
add_virtual_modifiers
()
:
Gdk.ModifierType
Adds virtual modifiers (i.e.
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. GDK already does this before delivering key events, but for compatibility reasons, it only sets the first virtual modifier it finds, whereas this function sets all matching virtual modifiers. This function is useful when matching key events against accelerators.
|
Gdk.Keymap | |
get_caps_lock_state
()
:
gboolean
Returns whether the Caps Lock modifer is locked.
Returns whether the Caps Lock modifer is locked.
|
Gdk.Keymap | |
get_direction
()
:
Pango.Direction
Returns the direction of the keymap.
Returns the direction of the keymap.
PANGO_DIRECTION_RTL.
|
Gdk.Keymap | |
Returns the keyvals bound to hardware_keycode.
Returns the keyvals bound to hardware_keycode.
The Nth GdkKeymapKey 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 gdk_keymap_translate_keyboard_state().
|
Gdk.Keymap | |
Obtains a list of keycode/group/level combinations that will
generate keyval.
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. GdkEventKey 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().
|
Gdk.Keymap | |
get_num_lock_state
()
:
gboolean
Returns whether the Num Lock modifer is locked.
Returns whether the Num Lock modifer is locked.
|
Gdk.Keymap | |
have_bidi_layouts
()
:
gboolean
Determines if keyboard layouts for both right-to-left and left-to-right
languages are in use.
Determines if keyboard layouts for both right-to-left and left-to-right
languages are in use.
|
Gdk.Keymap | |
Looks up the keyval mapped to a keycode/group/level triplet.
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 gdk_keymap_translate_keyboard_state() instead of this function, since the effective group/level may not be the same as the current keyboard state.
|
Gdk.Keymap | |
Maps the virtual modifiers (i.e.
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. This function is useful when matching key events against accelerators. same non-virtual modifier. Note that FALSE is also returned if a virtual modifier is mapped to a non-virtual modifier that was already set in state.
|
Gdk.Keymap | |
translate_keyboard_state
(guint32 hardware_keycode, ModifierType state, gint32 group, Object out_values)
:
gboolean
Translates the contents of a GdkEventKey into a keyval, effective
group, and level.
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 See 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 keyval, so this function isn't as useful as you might think. from state when comparing this key press to a hot key. For instance, on a US keyboard, the symbol is shifted, so when comparing a key press to a be masked out. /* We want to ignore irrelevant modifiers like ScrollLock */ #define ALL_ACCELS_MASK (GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_MOD1_MASK) gdk_keymap_translate_keyboard_state (keymap, event->hardware_keycode, event->state, event->group, &keyval, NULL, NULL, &consumed); if (keyval == GDK_PLUS && (event->state & ~consumed & ALL_ACCELS_MASK) == GDK_CONTROL_MASK) /* Control was pressed */ 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 modifiers, by doing: /* XXX Don't do this XXX */ if (keyval == accel_keyval && (event->state & ~consumed & ALL_ACCELS_MASK) == (accel_mods & ~consumed)) /* Accelerator was pressed */ However, this did not work if multi-modifier combinations were used in the keymap, since, for instance, would be masked out even if only was used in the keymap. To support this usage as well as well as possible, all that could affect the key for any combination of modifiers will be returned in consumed_modifiers; multi-modifier combinations are returned only when actually found in state. When you store accelerators, you should always store them with consumed modifiers removed. Store not
|
Gdk.Keymap |
Event | Defined By | |
---|---|---|
direction_changed (Keymap self)
:
none
The ::direction-changed signal gets emitted when the direction of
the keymap changes.
The ::direction-changed signal gets emitted when the direction of
the keymap changes.
|
Gdk.Keymap | |
keys_changed (Keymap self)
:
none
The ::keys-changed signal is emitted when the mapping represented by
The ::keys-changed signal is emitted when the mapping represented by
|
Gdk.Keymap | |
state_changed (Keymap self)
:
none
The ::state-changed signal is emitted when the state of the
keyboard changes, e.g when Caps Lock is turned on or off.
The ::state-changed signal is emitted when the state of the
keyboard changes, e.g when Caps Lock is turned on or off. See gdk_keymap_get_caps_lock_state().
|
Gdk.Keymap |