Package: gdk

GFlags gdk-modifier-type

Details

A set of bit-flags to indicate the state of modifier keys and mouse buttons in various event types. Typical modifier keys are Shift, Control, Meta, Super, Hyper, Alt, Compose, Apple, CapsLock or ShiftLock keys.

Like the X Window System, GDK supports 8 modifier keys and 5 mouse buttons.

GDK recognizes which of the Meta, Super or Hyper keys are mapped to Mod2 - Mod5, and indicates this by setting the :super-mask, :hyper-mask or :meta-mask mask in the state field of key events.

Note that GDK may add internal values to events which include reserved values such as GDK_MODIFIER_RESERVED_13_MASK. Your code should preserve and ignore them. You can use the :modifier-mask mask to remove all reserved values.

Also note that the GDK X backend interprets button press events for button 4-7 as scroll events, so the :button4-mask and :button5-mask masks will never be set.
(define-g-flags "GdkModifierType" gdk-modifier-type
  (:export t
   :type-initializer "gdk_modifier_type_get_type")
  (:shift-mask   #.(ash 1 0))
  (:lock-mask    #.(ash 1 1))
  (:control-mask #.(ash 1 2))
  (:mod1-mask    #.(ash 1 3))
  (:mod2-mask    #.(ash 1 4))
  (:mod3-mask    #.(ash 1 5))
  (:mod4-mask    #.(ash 1 6))
  (:mod5-mask    #.(ash 1 7))
  (:button1-mask #.(ash 1 8))
  (:button2-mask #.(ash 1 9))
  (:button3-mask #.(ash 1 10))
  (:button4-mask #.(ash 1 11))
  (:button5-mask #.(ash 1 12))
  (:super-mask   #.(ash 1 26))
  (:hyper-mask   #.(ash 1 27))
  (:meta-mask    #.(ash 1 28))
  (:release-mask #.(ash 1 30))
  (:modifier-mask #x5c001fff))  
:shift-mask
The Shift key.
:lock-mask
A Lock key, depending on the modifier mapping of the X server this may either be the CapsLock or ShiftLock key.
:control-mask
The Control key.
:mod1-mask
The fourth modifier key. It depends on the modifier mapping of the X server which key is interpreted as this modifier, but normally it is the Alt key.
:mod2-mask
The fifth modifier key. It depends on the modifier mapping of the X server which key is interpreted as this modifier.
:mod3-mask
The sixth modifier key. It depends on the modifier mapping of the X server which key is interpreted as this modifier.
:mod4-mask
The seventh modifier key. It depends on the modifier mapping of the X server which key is interpreted as this modifier.
:mod5-mask
The eighth modifier key. It depends on the modifier mapping of the X server which key is interpreted as this modifier.
:button1-mask
The first mouse button.
:button2-mask
The second mouse button.
:button3-mask
The third mouse button.
:button4-mask
The fourth mouse button.
:button5-mask
The fifth mouse button.
:super-mask
The Super modifier.
:hyper-mask
The Hyper modifier.
:meta-mask
The Meta modifier.
:release-mask
Not used in GDK itself. GTK uses it to differentiate between (keyval, modifiers) pairs from key press and release events.
:modifier-mask
A mask covering all modifier types.
 

See also

*2021-12-22