KeyEventProtocol
public protocol KeyEventProtocol : EventProtocol
The KeyEventProtocol
protocol exposes the methods and properties of an underlying GdkKeyEvent
instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see KeyEvent
.
Alternatively, use KeyEventRef
as a lighweight, unowned
reference if you already have an instance you just want to use.
An event related to a key-based device.
-
Untyped pointer to the underlying
GdkKeyEvent
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
key_event_ptr
Default implementationTyped pointer to the underlying
GdkKeyEvent
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GdkKeyEvent
instance.Declaration
Swift
var key_event_ptr: UnsafeMutablePointer<GdkKeyEvent>! { get }
-
Required Initialiser for types conforming to
KeyEventProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
getConsumedModifiers()
Extension methodExtracts the consumed modifiers from a key event.
Declaration
Swift
@inlinable func getConsumedModifiers() -> ModifierType
-
getKeycode()
Extension methodExtracts the keycode from a key event.
Declaration
Swift
@inlinable func getKeycode() -> Int
-
getKeyval()
Extension methodExtracts the keyval from a key event.
Declaration
Swift
@inlinable func getKeyval() -> Int
-
getLayout()
Extension methodExtracts the layout from a key event.
Declaration
Swift
@inlinable func getLayout() -> Int
-
getLevel()
Extension methodExtracts the shift level from a key event.
Declaration
Swift
@inlinable func getLevel() -> Int
-
getMatch(keyval:
Extension methodmodifiers: ) Gets a keyval and modifier combination that will match the event.
See [method
Gdk.KeyEvent.matches
].Declaration
Swift
@inlinable func getMatch(keyval: UnsafeMutablePointer<guint>!, modifiers: UnsafeMutablePointer<GdkModifierType>!) -> Bool
-
matches(keyval:
Extension methodmodifiers: ) Matches a key event against a keyval and modifiers.
This is typically used to trigger keyboard shortcuts such as Ctrl-C.
Partial matches are possible where the combination matches if the currently active group is ignored.
Note that we ignore Caps Lock for matching.
Declaration
Swift
@inlinable func matches(keyval: Int, modifiers: ModifierType) -> GdkKeyMatch
-
consumedModifiers
Extension methodExtracts the consumed modifiers from a key event.
Declaration
Swift
@inlinable var consumedModifiers: ModifierType { get }
-
isModifier
Extension methodExtracts whether the key event is for a modifier key.
Declaration
Swift
@inlinable var isModifier: Bool { get }
-
keycode
Extension methodExtracts the keycode from a key event.
Declaration
Swift
@inlinable var keycode: Int { get }
-
keyval
Extension methodExtracts the keyval from a key event.
Declaration
Swift
@inlinable var keyval: Int { get }
-
layout
Extension methodExtracts the layout from a key event.
Declaration
Swift
@inlinable var layout: Int { get }
-
level
Extension methodExtracts the shift level from a key event.
Declaration
Swift
@inlinable var level: Int { get }