ModifierType

public struct ModifierType : OptionSet

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.

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

Since 2.10, GDK recognizes which of the Meta, Super or Hyper keys are mapped to Mod2 - Mod5, and indicates this by setting GDK_SUPER_MASK, GDK_HYPER_MASK or GDK_META_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 GDK_MODIFIER_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 GDK_BUTTON4_MASK and GDK_BUTTON5_MASK will never be set.

  • The corresponding value of the raw type

    Declaration

    Swift

    public var rawValue: UInt32
  • The equivalent raw Int value

    Declaration

    Swift

    @inlinable
    public var intValue: Int { get set }
  • int

    The equivalent raw gint value

    Declaration

    Swift

    @inlinable
    public var int: gint { get set }
  • The equivalent underlying GdkModifierType enum value

    Declaration

    Swift

    @inlinable
    public var value: GdkModifierType { get set }
  • Creates a new instance with the specified raw value

    Declaration

    Swift

    @inlinable
    public init(rawValue: UInt32)
  • Creates a new instance with the specified GdkModifierType enum value

    Declaration

    Swift

    @inlinable
    public init(_ enumValue: GdkModifierType)
  • Creates a new instance with the specified Int value

    Declaration

    Swift

    @inlinable
    public init<I>(_ intValue: I) where I : BinaryInteger
  • the Shift key.

    Declaration

    Swift

    public static let shiftMask: ModifierType
  • a Lock key (depending on the modifier mapping of the X server this may either be CapsLock or ShiftLock).

    Declaration

    Swift

    public static let lockMask: ModifierType
  • the Control key.

    Declaration

    Swift

    public static let controlMask: ModifierType
  • 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).

    Declaration

    Swift

    public static let mod1Mask: ModifierType
  • the fifth modifier key (it depends on the modifier mapping of the X server which key is interpreted as this modifier).

    Declaration

    Swift

    public static let mod2Mask: ModifierType
  • the sixth modifier key (it depends on the modifier mapping of the X server which key is interpreted as this modifier).

    Declaration

    Swift

    public static let mod3Mask: ModifierType
  • the seventh modifier key (it depends on the modifier mapping of the X server which key is interpreted as this modifier).

    Declaration

    Swift

    public static let mod4Mask: ModifierType
  • the eighth modifier key (it depends on the modifier mapping of the X server which key is interpreted as this modifier).

    Declaration

    Swift

    public static let mod5Mask: ModifierType
  • the first mouse button.

    Declaration

    Swift

    public static let button1Mask: ModifierType
  • the second mouse button.

    Declaration

    Swift

    public static let button2Mask: ModifierType
  • the third mouse button.

    Declaration

    Swift

    public static let button3Mask: ModifierType
  • the fourth mouse button.

    Declaration

    Swift

    public static let button4Mask: ModifierType
  • the fifth mouse button.

    Declaration

    Swift

    public static let button5Mask: ModifierType
  • A reserved bit flag; do not use in your own code

    Declaration

    Swift

    public static let modifierReserved13Mask: ModifierType
  • A reserved bit flag; do not use in your own code

    Declaration

    Swift

    public static let modifierReserved14Mask: ModifierType
  • A reserved bit flag; do not use in your own code

    Declaration

    Swift

    public static let modifierReserved15Mask: ModifierType
  • A reserved bit flag; do not use in your own code

    Declaration

    Swift

    public static let modifierReserved16Mask: ModifierType
  • A reserved bit flag; do not use in your own code

    Declaration

    Swift

    public static let modifierReserved17Mask: ModifierType
  • A reserved bit flag; do not use in your own code

    Declaration

    Swift

    public static let modifierReserved18Mask: ModifierType
  • A reserved bit flag; do not use in your own code

    Declaration

    Swift

    public static let modifierReserved19Mask: ModifierType
  • A reserved bit flag; do not use in your own code

    Declaration

    Swift

    public static let modifierReserved20Mask: ModifierType
  • A reserved bit flag; do not use in your own code

    Declaration

    Swift

    public static let modifierReserved21Mask: ModifierType
  • A reserved bit flag; do not use in your own code

    Declaration

    Swift

    public static let modifierReserved22Mask: ModifierType
  • A reserved bit flag; do not use in your own code

    Declaration

    Swift

    public static let modifierReserved23Mask: ModifierType
  • A reserved bit flag; do not use in your own code

    Declaration

    Swift

    public static let modifierReserved24Mask: ModifierType
  • A reserved bit flag; do not use in your own code

    Declaration

    Swift

    public static let modifierReserved25Mask: ModifierType
  • the Super modifier. Since 2.10

    Declaration

    Swift

    public static let superMask: ModifierType
  • the Hyper modifier. Since 2.10

    Declaration

    Swift

    public static let hyperMask: ModifierType
  • the Meta modifier. Since 2.10

    Declaration

    Swift

    public static let metaMask: ModifierType
  • A reserved bit flag; do not use in your own code

    Declaration

    Swift

    public static let modifierReserved29Mask: ModifierType
  • not used in GDK itself. GTK+ uses it to differentiate between (keyval, modifiers) pairs from key press and release events.

    Declaration

    Swift

    public static let releaseMask: ModifierType
  • a mask covering all modifier types.

    Declaration

    Swift

    public static let modifierMask: ModifierType