Hoogle Search
Within LTS Haskell 24.45 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
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
-
gi-gdk3 GI.Gdk.Objects.Keymap Connect a signal handler for the stateChanged signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on keymap #stateChanged callback
toKeymap :: (MonadIO m, IsKeymap o) => o -> m Keymapgi-gdk3 GI.Gdk.Objects.Keymap Cast to Keymap, for types for which this is known to be safe. For general casts, use castTo.
visualGetColormapSize :: (HasCallStack, MonadIO m, IsVisual a) => a -> m Int32gi-gdk3 GI.Gdk.Objects.Visual Deprecated: (Since version 3.22)This information is not useful, since GDK does notprovide APIs to operate on colormaps.
windowGetFocusOnMap :: (HasCallStack, MonadIO m, IsWindow a) => a -> m Boolgi-gdk3 GI.Gdk.Objects.Window Determines whether or not the desktop environment should be hinted that the window does not want to receive input focus when it is mapped. Since: 2.22
windowSetFocusOnMap :: (HasCallStack, MonadIO m, IsWindow a) => a -> Bool -> m ()gi-gdk3 GI.Gdk.Objects.Window Setting focusOnMap to False hints the desktop environment that the window doesn’t want to receive input focus when it is mapped. focus_on_map should be turned off for windows that aren’t triggered interactively (such as popups from network activity). On X, it is the responsibility of the window manager to interpret this hint. Window managers following the freedesktop.org window manager extension specification should respect it. Since: 2.6