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
GdkKeyEventinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
key_event_ptrDefault implementationTyped pointer to the underlying
GdkKeyEventinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GdkKeyEventinstance.Declaration
Swift
var key_event_ptr: UnsafeMutablePointer<GdkKeyEvent>! { get } -
Required Initialiser for types conforming to
KeyEventProtocolDeclaration
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 -
consumedModifiersExtension methodExtracts the consumed modifiers from a key event.
Declaration
Swift
@inlinable var consumedModifiers: ModifierType { get } -
isModifierExtension methodExtracts whether the key event is for a modifier key.
Declaration
Swift
@inlinable var isModifier: Bool { get } -
keycodeExtension methodExtracts the keycode from a key event.
Declaration
Swift
@inlinable var keycode: Int { get } -
keyvalExtension methodExtracts the keyval from a key event.
Declaration
Swift
@inlinable var keyval: Int { get } -
layoutExtension methodExtracts the layout from a key event.
Declaration
Swift
@inlinable var layout: Int { get } -
levelExtension methodExtracts the shift level from a key event.
Declaration
Swift
@inlinable var level: Int { get }
View on GitHub
Install in Dash
KeyEventProtocol Protocol Reference