InputEventWithModifiers
Abstract base class for input events affected by modifier keys like [kbd]Shift[/kbd] and [kbd]Alt[/kbd].
InputEventWithModifiers.swift:11class InputEventWithModifiers
Stores information about mouse, keyboard, and touch gesture input events. This includes information about which modifier keys are pressed, such as [kbd]Shift[/kbd] or [kbd]Alt[/kbd]. See _input(event:)
.
Superclasses
class InputEventFromWindow
Abstract base class for
Viewport
-based input events.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Type members
Instance members
var altPressed: Bool
State of the [kbd]Alt[/kbd] modifier.
var commandOrControlAutoremap: Bool
Automatically use [kbd]Meta[/kbd] ([kbd]Cmd[/kbd]) on macOS and [kbd]Ctrl[/kbd] on other platforms. If
true
,ctrlPressed
andmetaPressed
cannot be set.var ctrlPressed: Bool
State of the [kbd]Ctrl[/kbd] modifier.
var metaPressed: Bool
State of the [kbd]Meta[/kbd] modifier. On Windows and Linux, this represents the Windows key (sometimes called “meta” or “super” on Linux). On macOS, this represents the Command key.
var shiftPressed: Bool
State of the [kbd]Shift[/kbd] modifier.
func getModifiersMask(
) -> KeyModifierMask Returns the keycode combination of modifier keys.
func isCommandOrControlPressed(
) -> Bool On macOS, returns
true
if [kbd]Meta[/kbd] ([kbd]Cmd[/kbd]) is pressed.
Subclasses
class InputEventGesture
Abstract base class for touch gestures.
class InputEventKey
Represents a key on a keyboard being pressed or released.
class InputEventMouse
Base input event type for mouse events.