InputEventKey

package
v0.0.0-...-a7442fb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2025 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

Package InputEventKey provides methods for working with InputEventKey object instances.

Index

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 Any

type Any interface {
	gd.IsClass
	AsInputEventKey() Instance
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

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 (self *Extension[T]) AsInputEventKey() Instance

func (*Extension[T]) AsInputEventWithModifiers

func (self *Extension[T]) AsInputEventWithModifiers() InputEventWithModifiers.Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsRefCounted

func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted

func (*Extension[T]) AsResource

func (self *Extension[T]) AsResource() Resource.Instance

type ID

type ID Object.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.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.InputEventKey

An input event for keys on a keyboard. Supports key presses, key releases and [member echo] events. It can also be received in [method Node._unhandled_key_input]. [b]Note:[/b] Events received from the keyboard usually have all properties set. Event mappings should have only one of the [member keycode], [member physical_keycode] or [member unicode] set. When events are compared, properties are checked in the following priority - [member keycode], [member physical_keycode] and [member unicode]. Events with the first matching value will be considered equal.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AsInputEvent

func (self Instance) AsInputEvent() InputEvent.Instance

func (Instance) AsInputEventFromWindow

func (self Instance) AsInputEventFromWindow() InputEventFromWindow.Instance

func (Instance) AsInputEventKey

func (self Instance) AsInputEventKey() Instance

func (Instance) AsInputEventWithModifiers

func (self Instance) AsInputEventWithModifiers() InputEventWithModifiers.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsResource

func (self Instance) AsResource() Resource.Instance

func (Instance) AsTextKeyLabel

func (self Instance) AsTextKeyLabel() string

Returns a [String] representation of the event's [member key_label] and modifiers.

func (Instance) AsTextKeycode

func (self Instance) AsTextKeycode() string

Returns a [String] representation of the event's [member keycode] and modifiers.

func (Instance) AsTextLocation

func (self Instance) AsTextLocation() string

Returns a [String] representation of the event's [member location]. This will be a blank string if the event is not specific to a location.

func (Instance) AsTextPhysicalKeycode

func (self Instance) AsTextPhysicalKeycode() string

Returns a [String] representation of the event's [member physical_keycode] and modifiers.

func (Instance) GetKeyLabelWithModifiers

func (self Instance) GetKeyLabelWithModifiers() Input.Key

Returns the localized key label combined with modifier keys such as [kbd]Shift[/kbd] or [kbd]Alt[/kbd]. See also [InputEventWithModifiers]. To get a human-readable representation of the [InputEventKey] with modifiers, use [code]OS.get_keycode_string(event.get_key_label_with_modifiers())[/code] where [code]event[/code] is the [InputEventKey].

func (Instance) GetKeycodeWithModifiers

func (self Instance) GetKeycodeWithModifiers() Input.Key

Returns the Latin keycode combined with modifier keys such as [kbd]Shift[/kbd] or [kbd]Alt[/kbd]. See also [InputEventWithModifiers]. To get a human-readable representation of the [InputEventKey] with modifiers, use [code]OS.get_keycode_string(event.get_keycode_with_modifiers())[/code] where [code]event[/code] is the [InputEventKey].

func (Instance) GetPhysicalKeycodeWithModifiers

func (self Instance) GetPhysicalKeycodeWithModifiers() Input.Key

Returns the physical keycode combined with modifier keys such as [kbd]Shift[/kbd] or [kbd]Alt[/kbd]. See also [InputEventWithModifiers]. To get a human-readable representation of the [InputEventKey] with modifiers, use [code]OS.get_keycode_string(event.get_physical_keycode_with_modifiers())[/code] where [code]event[/code] is the [InputEventKey].

func (Instance) ID

func (self Instance) ID() ID

func (Instance) KeyLabel

func (self Instance) KeyLabel() Input.Key

func (Instance) Keycode

func (self Instance) Keycode() Input.Key

func (Instance) Location

func (self Instance) Location() Input.KeyLocation

func (Instance) PhysicalKeycode

func (self Instance) PhysicalKeycode() Input.Key

func (Instance) SetEcho

func (self Instance) SetEcho(value bool)

func (Instance) SetKeyLabel

func (self Instance) SetKeyLabel(value Input.Key)

func (Instance) SetKeycode

func (self Instance) SetKeycode(value Input.Key)

func (Instance) SetLocation

func (self Instance) SetLocation(value Input.KeyLocation)

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetPhysicalKeycode

func (self Instance) SetPhysicalKeycode(value Input.Key)

func (Instance) SetPressed

func (self Instance) SetPressed(value bool)

func (Instance) SetUnicode

func (self Instance) SetUnicode(value int)

func (Instance) Unicode

func (self Instance) Unicode() int

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL