Hoogle Search
Within LTS Haskell 24.40 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
gi-gdk3 GI.Gdk.Objects.Keymap Returns the modifier mask the keymap’s windowing system backend uses for a particular purpose. Note that this function always returns real hardware modifiers, not virtual ones (e.g. it will return GDK_MOD1_MASK rather than GDK_META_MASK if the backend maps MOD1 to META), so there are use cases where the return value of this function has to be transformed by keymapAddVirtualModifiers in order to contain the expected result. Since: 3.4
keymapGetModifierState :: (HasCallStack, MonadIO m, IsKeymap a) => a -> m Word32gi-gdk3 GI.Gdk.Objects.Keymap Returns the current modifier state. Since: 3.4
keymapGetNumLockState :: (HasCallStack, MonadIO m, IsKeymap a) => a -> m Boolgi-gdk3 GI.Gdk.Objects.Keymap Returns whether the Num Lock modifer is locked. Since: 3.0
keymapGetScrollLockState :: (HasCallStack, MonadIO m, IsKeymap a) => a -> m Boolgi-gdk3 GI.Gdk.Objects.Keymap Returns whether the Scroll Lock modifer is locked. Since: 3.18
keymapHaveBidiLayouts :: (HasCallStack, MonadIO m, IsKeymap a) => a -> m Boolgi-gdk3 GI.Gdk.Objects.Keymap Determines if keyboard layouts for both right-to-left and left-to-right languages are in use. Since: 2.12
keymapLookupKey :: (HasCallStack, MonadIO m, IsKeymap a) => a -> KeymapKey -> m Word32gi-gdk3 GI.Gdk.Objects.Keymap 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 keymapTranslateKeyboardState instead of this function, since the effective group/level may not be the same as the current keyboard state.
-
gi-gdk3 GI.Gdk.Objects.Keymap 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. Since: 2.20
-
gi-gdk3 GI.Gdk.Objects.Keymap 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 consumedModifiers. See [Groups][key-group-explanation] for an explanation of groups and levels. The effectiveGroup 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. consumedModifiers gives modifiers that should be masked outfrom 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.
C code
// 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 consumedModifiers 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:C code
// 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, <Control> would be masked out even if only <Control><Alt> was used in the keymap. To support this usage as well as well as possible, all single modifier combinations that could affect the key for any combination of modifiers will be returned in consumedModifiers; 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 <Control>plus, not <Control><Shift>plus, -
gi-gdk3 GI.Gdk.Objects.Keymap Connect a signal handler for the directionChanged signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on keymap #directionChanged callback
-
gi-gdk3 GI.Gdk.Objects.Keymap Connect a signal handler for the keysChanged signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on keymap #keysChanged callback