Documentation
¶
Overview ¶
An input event for keys on a keyboard. Supports key presses, key releases and [Instance.Echo] events. It can also be received in graphics.gd/classdb/Node.Instance.UnhandledKeyInput.
Note: Events received from the keyboard usually have all properties set. Event mappings should have only one of the Instance.Keycode, Instance.PhysicalKeycode or Instance.Unicode set.
When events are compared, properties are checked in the following priority - Instance.Keycode, Instance.PhysicalKeycode and Instance.Unicode. Events with the first matching value will be considered equal.
Index ¶
- type Advanced
- type Any
- type Extension
- func (self *Extension[T]) AsInputEvent() InputEvent.Instance
- func (self *Extension[T]) AsInputEventFromWindow() InputEventFromWindow.Instance
- func (self *Extension[T]) AsInputEventKey() Instance
- func (self *Extension[T]) AsInputEventWithModifiers() InputEventWithModifiers.Instance
- func (self *Extension[T]) AsObject() [1]gd.Object
- func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
- func (self *Extension[T]) AsResource() Resource.Instance
- type ID
- type Instance
- func (self Instance) AsInputEvent() InputEvent.Instance
- func (self Instance) AsInputEventFromWindow() InputEventFromWindow.Instance
- func (self Instance) AsInputEventKey() Instance
- func (self Instance) AsInputEventWithModifiers() InputEventWithModifiers.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsResource() Resource.Instance
- func (self Instance) AsTextKeyLabel() string
- func (self Instance) AsTextKeycode() string
- func (self Instance) AsTextLocation() string
- func (self Instance) AsTextPhysicalKeycode() string
- func (self Instance) GetKeyLabelWithModifiers() Input.Key
- func (self Instance) GetKeycodeWithModifiers() Input.Key
- func (self Instance) GetPhysicalKeycodeWithModifiers() Input.Key
- func (self Instance) ID() ID
- func (self Instance) KeyLabel() Input.Key
- func (self Instance) Keycode() Input.Key
- func (self Instance) Location() Input.KeyLocation
- func (self Instance) PhysicalKeycode() Input.Key
- func (self Instance) SetEcho(value bool)
- func (self Instance) SetKeyLabel(value Input.Key)
- func (self Instance) SetKeycode(value Input.Key)
- func (self Instance) SetLocation(value Input.KeyLocation)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetPhysicalKeycode(value Input.Key)
- func (self Instance) SetPressed(value bool)
- func (self Instance) SetUnicode(value int)
- func (self Instance) Unicode() int
- func (self Instance) Virtual(name string) reflect.Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsInputEvent ¶
func (self *Extension[T]) AsInputEvent() InputEvent.Instance
func (*Extension[T]) AsInputEventFromWindow ¶
func (self *Extension[T]) AsInputEventFromWindow() InputEventFromWindow.Instance
func (*Extension[T]) AsInputEventKey ¶
func (*Extension[T]) AsInputEventWithModifiers ¶
func (self *Extension[T]) AsInputEventWithModifiers() InputEventWithModifiers.Instance
func (*Extension[T]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
func (*Extension[T]) AsResource ¶
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
type Instance [1]gdclass.InputEventKey
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsInputEvent ¶
func (self Instance) AsInputEvent() InputEvent.Instance
func (Instance) AsInputEventFromWindow ¶
func (self Instance) AsInputEventFromWindow() InputEventFromWindow.Instance
func (Instance) AsInputEventKey ¶
func (Instance) AsInputEventWithModifiers ¶
func (self Instance) AsInputEventWithModifiers() InputEventWithModifiers.Instance
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsResource ¶
func (Instance) AsTextKeyLabel ¶
Returns a string representation of the event's Instance.KeyLabel and modifiers.
func (Instance) AsTextKeycode ¶
Returns a string representation of the event's Instance.Keycode and modifiers.
func (Instance) AsTextLocation ¶
Returns a string representation of the event's Instance.Location. This will be a blank string if the event is not specific to a location.
func (Instance) AsTextPhysicalKeycode ¶
Returns a string representation of the event's Instance.PhysicalKeycode and modifiers.
func (Instance) GetKeyLabelWithModifiers ¶
Returns the localized key label combined with modifier keys such as Shift or Alt. See also graphics.gd/classdb/InputEventWithModifiers.
To get a human-readable representation of the graphics.gd/classdb/InputEventKey with modifiers, use OS.get_keycode_string(event.get_key_label_with_modifiers()) where event is the graphics.gd/classdb/InputEventKey.
func (Instance) GetKeycodeWithModifiers ¶
Returns the Latin keycode combined with modifier keys such as Shift or Alt. See also graphics.gd/classdb/InputEventWithModifiers.
To get a human-readable representation of the graphics.gd/classdb/InputEventKey with modifiers, use OS.get_keycode_string(event.get_keycode_with_modifiers()) where event is the graphics.gd/classdb/InputEventKey.
func (Instance) GetPhysicalKeycodeWithModifiers ¶
Returns the physical keycode combined with modifier keys such as Shift or Alt. See also graphics.gd/classdb/InputEventWithModifiers.
To get a human-readable representation of the graphics.gd/classdb/InputEventKey with modifiers, use OS.get_keycode_string(event.get_physical_keycode_with_modifiers()) where event is the graphics.gd/classdb/InputEventKey.
func (Instance) Location ¶
func (self Instance) Location() Input.KeyLocation
func (Instance) PhysicalKeycode ¶
func (Instance) SetKeyLabel ¶
func (Instance) SetKeycode ¶
func (Instance) SetLocation ¶
func (self Instance) SetLocation(value Input.KeyLocation)