input

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package input provides Go bindings for Android Input events.

Index

Constants

View Source
const (
	AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT = 8
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ALooper

type ALooper = capi.ALooper

type ALooper_callbackFunc

type ALooper_callbackFunc = capi.ALooper_callbackFunc

type Error

type Error int32

Error represents an NDK error code.

func (Error) Error

func (e Error) Error() string

type Event

type Event struct {
	// contains filtered or unexported fields
}

Event wraps the NDK AInputEvent handle.

func NewEventFromPointer

func NewEventFromPointer(ptr unsafe.Pointer) *Event

NewEventFromPointer wraps a raw AInputEvent pointer.

func (*Event) AKeyEvent_getDownTime

func (h *Event) AKeyEvent_getDownTime() int64

AKeyEvent_getDownTime returns the value directly.

func (*Event) AKeyEvent_getEventTime

func (h *Event) AKeyEvent_getEventTime() int64

AKeyEvent_getEventTime returns the value directly.

func (*Event) AKeyEvent_getFlags

func (h *Event) AKeyEvent_getFlags() error

AKeyEvent_getFlags calls the underlying NDK function.

func (*Event) AKeyEvent_getMetaState

func (h *Event) AKeyEvent_getMetaState() error

AKeyEvent_getMetaState calls the underlying NDK function.

func (*Event) AKeyEvent_getScanCode

func (h *Event) AKeyEvent_getScanCode() error

AKeyEvent_getScanCode calls the underlying NDK function.

func (*Event) AMotionEvent_getActionButton

func (h *Event) AMotionEvent_getActionButton() error

AMotionEvent_getActionButton calls the underlying NDK function.

func (*Event) AMotionEvent_getAxisValue

func (h *Event) AMotionEvent_getAxisValue(axis int32, pointer_index uint64) float32

AMotionEvent_getAxisValue returns the value directly.

func (*Event) AMotionEvent_getButtonState

func (h *Event) AMotionEvent_getButtonState() error

AMotionEvent_getButtonState calls the underlying NDK function.

func (*Event) AMotionEvent_getClassification

func (h *Event) AMotionEvent_getClassification() error

AMotionEvent_getClassification calls the underlying NDK function.

func (*Event) AMotionEvent_getDownTime

func (h *Event) AMotionEvent_getDownTime() int64

AMotionEvent_getDownTime returns the value directly.

func (*Event) AMotionEvent_getEdgeFlags

func (h *Event) AMotionEvent_getEdgeFlags() error

AMotionEvent_getEdgeFlags calls the underlying NDK function.

func (*Event) AMotionEvent_getEventTime

func (h *Event) AMotionEvent_getEventTime() int64

AMotionEvent_getEventTime returns the value directly.

func (*Event) AMotionEvent_getFlags

func (h *Event) AMotionEvent_getFlags() error

AMotionEvent_getFlags calls the underlying NDK function.

func (*Event) AMotionEvent_getHistoricalAxisValue

func (h *Event) AMotionEvent_getHistoricalAxisValue(axis int32, pointer_index uint64, history_index uint64) float32

AMotionEvent_getHistoricalAxisValue returns the value directly.

func (*Event) AMotionEvent_getHistoricalEventTime

func (h *Event) AMotionEvent_getHistoricalEventTime(history_index uint64) int64

AMotionEvent_getHistoricalEventTime returns the value directly.

func (*Event) AMotionEvent_getHistoricalOrientation

func (h *Event) AMotionEvent_getHistoricalOrientation(pointer_index uint64, history_index uint64) float32

AMotionEvent_getHistoricalOrientation returns the value directly.

func (*Event) AMotionEvent_getHistoricalPressure

func (h *Event) AMotionEvent_getHistoricalPressure(pointer_index uint64, history_index uint64) float32

AMotionEvent_getHistoricalPressure returns the value directly.

func (*Event) AMotionEvent_getHistoricalRawX

func (h *Event) AMotionEvent_getHistoricalRawX(pointer_index uint64, history_index uint64) float32

AMotionEvent_getHistoricalRawX returns the value directly.

func (*Event) AMotionEvent_getHistoricalRawY

func (h *Event) AMotionEvent_getHistoricalRawY(pointer_index uint64, history_index uint64) float32

AMotionEvent_getHistoricalRawY returns the value directly.

func (*Event) AMotionEvent_getHistoricalSize

func (h *Event) AMotionEvent_getHistoricalSize(pointer_index uint64, history_index uint64) float32

AMotionEvent_getHistoricalSize returns the value directly.

func (*Event) AMotionEvent_getHistoricalToolMajor

func (h *Event) AMotionEvent_getHistoricalToolMajor(pointer_index uint64, history_index uint64) float32

AMotionEvent_getHistoricalToolMajor returns the value directly.

func (*Event) AMotionEvent_getHistoricalToolMinor

func (h *Event) AMotionEvent_getHistoricalToolMinor(pointer_index uint64, history_index uint64) float32

AMotionEvent_getHistoricalToolMinor returns the value directly.

func (*Event) AMotionEvent_getHistoricalTouchMajor

func (h *Event) AMotionEvent_getHistoricalTouchMajor(pointer_index uint64, history_index uint64) float32

AMotionEvent_getHistoricalTouchMajor returns the value directly.

func (*Event) AMotionEvent_getHistoricalTouchMinor

func (h *Event) AMotionEvent_getHistoricalTouchMinor(pointer_index uint64, history_index uint64) float32

AMotionEvent_getHistoricalTouchMinor returns the value directly.

func (*Event) AMotionEvent_getHistoricalX

func (h *Event) AMotionEvent_getHistoricalX(pointer_index uint64, history_index uint64) float32

AMotionEvent_getHistoricalX returns the value directly.

func (*Event) AMotionEvent_getHistoricalY

func (h *Event) AMotionEvent_getHistoricalY(pointer_index uint64, history_index uint64) float32

AMotionEvent_getHistoricalY returns the value directly.

func (*Event) AMotionEvent_getHistorySize

func (h *Event) AMotionEvent_getHistorySize() uint64

AMotionEvent_getHistorySize returns the value directly.

func (*Event) AMotionEvent_getMetaState

func (h *Event) AMotionEvent_getMetaState() error

AMotionEvent_getMetaState calls the underlying NDK function.

func (*Event) AMotionEvent_getOrientation

func (h *Event) AMotionEvent_getOrientation(pointer_index uint64) float32

AMotionEvent_getOrientation returns the value directly.

func (*Event) AMotionEvent_getPointerID

func (h *Event) AMotionEvent_getPointerID(pointer_index uint64) error

AMotionEvent_getPointerID calls the underlying NDK function.

func (*Event) AMotionEvent_getRawX

func (h *Event) AMotionEvent_getRawX(pointer_index uint64) float32

AMotionEvent_getRawX returns the value directly.

func (*Event) AMotionEvent_getRawY

func (h *Event) AMotionEvent_getRawY(pointer_index uint64) float32

AMotionEvent_getRawY returns the value directly.

func (*Event) AMotionEvent_getSize

func (h *Event) AMotionEvent_getSize(pointer_index uint64) float32

AMotionEvent_getSize returns the value directly.

func (*Event) AMotionEvent_getToolMajor

func (h *Event) AMotionEvent_getToolMajor(pointer_index uint64) float32

AMotionEvent_getToolMajor returns the value directly.

func (*Event) AMotionEvent_getToolMinor

func (h *Event) AMotionEvent_getToolMinor(pointer_index uint64) float32

AMotionEvent_getToolMinor returns the value directly.

func (*Event) AMotionEvent_getToolType

func (h *Event) AMotionEvent_getToolType(pointer_index uint64) error

AMotionEvent_getToolType calls the underlying NDK function.

func (*Event) AMotionEvent_getTouchMajor

func (h *Event) AMotionEvent_getTouchMajor(pointer_index uint64) float32

AMotionEvent_getTouchMajor returns the value directly.

func (*Event) AMotionEvent_getTouchMinor

func (h *Event) AMotionEvent_getTouchMinor(pointer_index uint64) float32

AMotionEvent_getTouchMinor returns the value directly.

func (*Event) AMotionEvent_getXOffset

func (h *Event) AMotionEvent_getXOffset() float32

AMotionEvent_getXOffset returns the value directly.

func (*Event) AMotionEvent_getXPrecision

func (h *Event) AMotionEvent_getXPrecision() float32

AMotionEvent_getXPrecision returns the value directly.

func (*Event) AMotionEvent_getYOffset

func (h *Event) AMotionEvent_getYOffset() float32

AMotionEvent_getYOffset returns the value directly.

func (*Event) AMotionEvent_getYPrecision

func (h *Event) AMotionEvent_getYPrecision() float32

AMotionEvent_getYPrecision returns the value directly.

func (*Event) Close

func (h *Event) Close() error

Close releases the underlying NDK handle.

func (*Event) GetDeviceID

func (h *Event) GetDeviceID() error

GetDeviceID calls the underlying NDK function.

func (*Event) KeyAction

func (h *Event) KeyAction() int32

KeyAction returns the value directly.

func (*Event) KeyCode

func (h *Event) KeyCode() int32

KeyCode returns the value directly.

func (*Event) MotionAction

func (h *Event) MotionAction() int32

MotionAction returns the value directly.

func (*Event) Pointer

func (h *Event) Pointer() unsafe.Pointer

Pointer returns the underlying pointer as unsafe.Pointer.

func (*Event) PointerCount

func (h *Event) PointerCount() uint64

PointerCount returns the value directly.

func (*Event) Pressure

func (h *Event) Pressure(pointer_index uint64) float32

Pressure returns the value directly.

func (*Event) RepeatCount

func (h *Event) RepeatCount() int32

RepeatCount returns the value directly.

func (*Event) Source

func (h *Event) Source() int32

Source returns the value directly.

func (*Event) Type

func (h *Event) Type() int32

Type returns the value directly.

func (*Event) X

func (h *Event) X(pointer_index uint64) float32

X returns the value directly.

func (*Event) Y

func (h *Event) Y(pointer_index uint64) float32

Y returns the value directly.

type EventType

type EventType int32
const (
	Key       EventType = 1
	Motion    EventType = 2
	Focus     EventType = 3
	Capture   EventType = 4
	Drag      EventType = 5
	TouchMode EventType = 6
)

func (EventType) String

func (v EventType) String() string

type INPUT_KEYBOARD_TYPE

type INPUT_KEYBOARD_TYPE int32
const (
	AINPUT_KEYBOARD_TYPE_NONE           INPUT_KEYBOARD_TYPE = 0
	AINPUT_KEYBOARD_TYPE_NON_ALPHABETIC INPUT_KEYBOARD_TYPE = 1
	AINPUT_KEYBOARD_TYPE_ALPHABETIC     INPUT_KEYBOARD_TYPE = 2
)

type INPUT_MOTION_RANGE

type INPUT_MOTION_RANGE int32
const (
	AINPUT_MOTION_RANGE_X           INPUT_MOTION_RANGE = 0
	AINPUT_MOTION_RANGE_Y           INPUT_MOTION_RANGE = 1
	AINPUT_MOTION_RANGE_PRESSURE    INPUT_MOTION_RANGE = 2
	AINPUT_MOTION_RANGE_SIZE        INPUT_MOTION_RANGE = 3
	AINPUT_MOTION_RANGE_TOUCH_MAJOR INPUT_MOTION_RANGE = 4
	AINPUT_MOTION_RANGE_TOUCH_MINOR INPUT_MOTION_RANGE = 5
	AINPUT_MOTION_RANGE_TOOL_MAJOR  INPUT_MOTION_RANGE = 6
	AINPUT_MOTION_RANGE_TOOL_MINOR  INPUT_MOTION_RANGE = 7
	AINPUT_MOTION_RANGE_ORIENTATION INPUT_MOTION_RANGE = 8
)

type INPUT_SOURCE_CLASS

type INPUT_SOURCE_CLASS int32
const (
	AINPUT_SOURCE_CLASS_MASK       INPUT_SOURCE_CLASS = 255
	AINPUT_SOURCE_CLASS_NONE       INPUT_SOURCE_CLASS = 0
	AINPUT_SOURCE_CLASS_BUTTON     INPUT_SOURCE_CLASS = 1
	AINPUT_SOURCE_CLASS_POINTER    INPUT_SOURCE_CLASS = 2
	AINPUT_SOURCE_CLASS_NAVIGATION INPUT_SOURCE_CLASS = 4
	AINPUT_SOURCE_CLASS_POSITION   INPUT_SOURCE_CLASS = 8
	AINPUT_SOURCE_CLASS_JOYSTICK   INPUT_SOURCE_CLASS = 16
)

type JNIEnv

type JNIEnv = capi.JNIEnv

type Jobject

type Jobject = capi.Jobject

type KEY_EVENT_FLAG

type KEY_EVENT_FLAG int32
const (
	AKEY_EVENT_FLAG_WOKE_HERE           KEY_EVENT_FLAG = 1
	AKEY_EVENT_FLAG_SOFT_KEYBOARD       KEY_EVENT_FLAG = 2
	AKEY_EVENT_FLAG_KEEP_TOUCH_MODE     KEY_EVENT_FLAG = 4
	AKEY_EVENT_FLAG_FROM_SYSTEM         KEY_EVENT_FLAG = 8
	AKEY_EVENT_FLAG_EDITOR_ACTION       KEY_EVENT_FLAG = 16
	AKEY_EVENT_FLAG_CANCELED            KEY_EVENT_FLAG = 32
	AKEY_EVENT_FLAG_VIRTUAL_HARD_KEY    KEY_EVENT_FLAG = 64
	AKEY_EVENT_FLAG_LONG_PRESS          KEY_EVENT_FLAG = 128
	AKEY_EVENT_FLAG_CANCELED_LONG_PRESS KEY_EVENT_FLAG = 256
	AKEY_EVENT_FLAG_TRACKING            KEY_EVENT_FLAG = 512
	AKEY_EVENT_FLAG_FALLBACK            KEY_EVENT_FLAG = 1024
)

type KEY_STATE

type KEY_STATE int32
const (
	AKEY_STATE_UNKNOWN KEY_STATE = -1
	AKEY_STATE_UP      KEY_STATE = 0
	AKEY_STATE_DOWN    KEY_STATE = 1
	AKEY_STATE_VIRTUAL KEY_STATE = 2
)

type KeyAction

type KeyAction int32
const (
	Down     KeyAction = 0
	Up       KeyAction = 1
	Multiple KeyAction = 2
)

func (KeyAction) String

func (v KeyAction) String() string

type META

type META int32
const (
	AMETA_NONE           META = 0
	AMETA_ALT_ON         META = 2
	AMETA_ALT_LEFT_ON    META = 16
	AMETA_ALT_RIGHT_ON   META = 32
	AMETA_SHIFT_ON       META = 1
	AMETA_SHIFT_LEFT_ON  META = 64
	AMETA_SHIFT_RIGHT_ON META = 128
	AMETA_SYM_ON         META = 4
	AMETA_FUNCTION_ON    META = 8
	AMETA_CTRL_ON        META = 4096
	AMETA_CTRL_LEFT_ON   META = 8192
	AMETA_CTRL_RIGHT_ON  META = 16384
	AMETA_META_ON        META = 65536
	AMETA_META_LEFT_ON   META = 131072
	AMETA_META_RIGHT_ON  META = 262144
	AMETA_CAPS_LOCK_ON   META = 1048576
	AMETA_NUM_LOCK_ON    META = 2097152
	AMETA_SCROLL_LOCK_ON META = 4194304
)

type MOTION_EVENT

type MOTION_EVENT int32
const (
	AMOTION_EVENT_AXIS_X                          MOTION_EVENT = 0
	AMOTION_EVENT_AXIS_Y                          MOTION_EVENT = 1
	AMOTION_EVENT_AXIS_PRESSURE                   MOTION_EVENT = 2
	AMOTION_EVENT_AXIS_SIZE                       MOTION_EVENT = 3
	AMOTION_EVENT_AXIS_TOUCH_MAJOR                MOTION_EVENT = 4
	AMOTION_EVENT_AXIS_TOUCH_MINOR                MOTION_EVENT = 5
	AMOTION_EVENT_AXIS_TOOL_MAJOR                 MOTION_EVENT = 6
	AMOTION_EVENT_AXIS_TOOL_MINOR                 MOTION_EVENT = 7
	AMOTION_EVENT_AXIS_ORIENTATION                MOTION_EVENT = 8
	AMOTION_EVENT_AXIS_VSCROLL                    MOTION_EVENT = 9
	AMOTION_EVENT_AXIS_HSCROLL                    MOTION_EVENT = 10
	AMOTION_EVENT_AXIS_Z                          MOTION_EVENT = 11
	AMOTION_EVENT_AXIS_RX                         MOTION_EVENT = 12
	AMOTION_EVENT_AXIS_RY                         MOTION_EVENT = 13
	AMOTION_EVENT_AXIS_RZ                         MOTION_EVENT = 14
	AMOTION_EVENT_AXIS_HAT_X                      MOTION_EVENT = 15
	AMOTION_EVENT_AXIS_HAT_Y                      MOTION_EVENT = 16
	AMOTION_EVENT_AXIS_LTRIGGER                   MOTION_EVENT = 17
	AMOTION_EVENT_AXIS_RTRIGGER                   MOTION_EVENT = 18
	AMOTION_EVENT_AXIS_THROTTLE                   MOTION_EVENT = 19
	AMOTION_EVENT_AXIS_RUDDER                     MOTION_EVENT = 20
	AMOTION_EVENT_AXIS_WHEEL                      MOTION_EVENT = 21
	AMOTION_EVENT_AXIS_GAS                        MOTION_EVENT = 22
	AMOTION_EVENT_AXIS_BRAKE                      MOTION_EVENT = 23
	AMOTION_EVENT_AXIS_DISTANCE                   MOTION_EVENT = 24
	AMOTION_EVENT_AXIS_TILT                       MOTION_EVENT = 25
	AMOTION_EVENT_AXIS_SCROLL                     MOTION_EVENT = 26
	AMOTION_EVENT_AXIS_RELATIVE_X                 MOTION_EVENT = 27
	AMOTION_EVENT_AXIS_RELATIVE_Y                 MOTION_EVENT = 28
	AMOTION_EVENT_AXIS_GENERIC_1                  MOTION_EVENT = 32
	AMOTION_EVENT_AXIS_GENERIC_2                  MOTION_EVENT = 33
	AMOTION_EVENT_AXIS_GENERIC_3                  MOTION_EVENT = 34
	AMOTION_EVENT_AXIS_GENERIC_4                  MOTION_EVENT = 35
	AMOTION_EVENT_AXIS_GENERIC_5                  MOTION_EVENT = 36
	AMOTION_EVENT_AXIS_GENERIC_6                  MOTION_EVENT = 37
	AMOTION_EVENT_AXIS_GENERIC_7                  MOTION_EVENT = 38
	AMOTION_EVENT_AXIS_GENERIC_8                  MOTION_EVENT = 39
	AMOTION_EVENT_AXIS_GENERIC_9                  MOTION_EVENT = 40
	AMOTION_EVENT_AXIS_GENERIC_10                 MOTION_EVENT = 41
	AMOTION_EVENT_AXIS_GENERIC_11                 MOTION_EVENT = 42
	AMOTION_EVENT_AXIS_GENERIC_12                 MOTION_EVENT = 43
	AMOTION_EVENT_AXIS_GENERIC_13                 MOTION_EVENT = 44
	AMOTION_EVENT_AXIS_GENERIC_14                 MOTION_EVENT = 45
	AMOTION_EVENT_AXIS_GENERIC_15                 MOTION_EVENT = 46
	AMOTION_EVENT_AXIS_GENERIC_16                 MOTION_EVENT = 47
	AMOTION_EVENT_AXIS_GESTURE_X_OFFSET           MOTION_EVENT = 48
	AMOTION_EVENT_AXIS_GESTURE_Y_OFFSET           MOTION_EVENT = 49
	AMOTION_EVENT_AXIS_GESTURE_SCROLL_X_DISTANCE  MOTION_EVENT = 50
	AMOTION_EVENT_AXIS_GESTURE_SCROLL_Y_DISTANCE  MOTION_EVENT = 51
	AMOTION_EVENT_AXIS_GESTURE_PINCH_SCALE_FACTOR MOTION_EVENT = 52
	AMOTION_EVENT_AXIS_GESTURE_SWIPE_FINGER_COUNT MOTION_EVENT = 53
	AMOTION_EVENT_MAXIMUM_VALID_AXIS_VALUE        MOTION_EVENT = 53
)

type MOTION_EVENT_BUTTON

type MOTION_EVENT_BUTTON int32
const (
	AMOTION_EVENT_BUTTON_PRIMARY          MOTION_EVENT_BUTTON = 1
	AMOTION_EVENT_BUTTON_SECONDARY        MOTION_EVENT_BUTTON = 2
	AMOTION_EVENT_BUTTON_TERTIARY         MOTION_EVENT_BUTTON = 4
	AMOTION_EVENT_BUTTON_BACK             MOTION_EVENT_BUTTON = 8
	AMOTION_EVENT_BUTTON_FORWARD          MOTION_EVENT_BUTTON = 16
	AMOTION_EVENT_BUTTON_STYLUS_PRIMARY   MOTION_EVENT_BUTTON = 32
	AMOTION_EVENT_BUTTON_STYLUS_SECONDARY MOTION_EVENT_BUTTON = 64
)

type MOTION_EVENT_EDGE_FLAG

type MOTION_EVENT_EDGE_FLAG int32
const (
	AMOTION_EVENT_EDGE_FLAG_NONE   MOTION_EVENT_EDGE_FLAG = 0
	AMOTION_EVENT_EDGE_FLAG_TOP    MOTION_EVENT_EDGE_FLAG = 1
	AMOTION_EVENT_EDGE_FLAG_BOTTOM MOTION_EVENT_EDGE_FLAG = 2
	AMOTION_EVENT_EDGE_FLAG_LEFT   MOTION_EVENT_EDGE_FLAG = 4
	AMOTION_EVENT_EDGE_FLAG_RIGHT  MOTION_EVENT_EDGE_FLAG = 8
)

type MOTION_EVENT_FLAG_WINDOW

type MOTION_EVENT_FLAG_WINDOW int32
const (
	AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED MOTION_EVENT_FLAG_WINDOW = 1
)

type MOTION_EVENT_TOOL_TYPE

type MOTION_EVENT_TOOL_TYPE int32
const (
	AMOTION_EVENT_TOOL_TYPE_UNKNOWN MOTION_EVENT_TOOL_TYPE = 0
	AMOTION_EVENT_TOOL_TYPE_FINGER  MOTION_EVENT_TOOL_TYPE = 1
	AMOTION_EVENT_TOOL_TYPE_STYLUS  MOTION_EVENT_TOOL_TYPE = 2
	AMOTION_EVENT_TOOL_TYPE_MOUSE   MOTION_EVENT_TOOL_TYPE = 3
	AMOTION_EVENT_TOOL_TYPE_ERASER  MOTION_EVENT_TOOL_TYPE = 4
	AMOTION_EVENT_TOOL_TYPE_PALM    MOTION_EVENT_TOOL_TYPE = 5
)

type MotionAction

type MotionAction int32
const (
	ActionMask             MotionAction = 255
	ActionPointerIndexMask MotionAction = 65280
	ActionDown             MotionAction = 0
	ActionUp               MotionAction = 1
	ActionMove             MotionAction = 2
	ActionCancel           MotionAction = 3
	ActionOutside          MotionAction = 4
	ActionPointerDown      MotionAction = 5
	ActionPointerUp        MotionAction = 6
	ActionHoverMove        MotionAction = 7
	ActionScroll           MotionAction = 8
	ActionHoverEnter       MotionAction = 9
	ActionHoverExit        MotionAction = 10
	ActionButtonPress      MotionAction = 11
	ActionButtonRelease    MotionAction = 12
)

func (MotionAction) String

func (v MotionAction) String() string

type MotionClassification

type MotionClassification int32
const (
	AMOTION_EVENT_CLASSIFICATION_NONE               MotionClassification = 0
	AMOTION_EVENT_CLASSIFICATION_AMBIGUOUS_GESTURE  MotionClassification = 1
	AMOTION_EVENT_CLASSIFICATION_DEEP_PRESS         MotionClassification = 2
	AMOTION_EVENT_CLASSIFICATION_TWO_FINGER_SWIPE   MotionClassification = 3
	AMOTION_EVENT_CLASSIFICATION_MULTI_FINGER_SWIPE MotionClassification = 4
	AMOTION_EVENT_CLASSIFICATION_PINCH              MotionClassification = 5
)

type Queue

type Queue struct {
	// contains filtered or unexported fields
}

Queue wraps the NDK AInputQueue handle.

func NewQueueFromPointer

func NewQueueFromPointer(ptr unsafe.Pointer) *Queue

NewQueueFromPointer wraps a raw AInputQueue pointer.

func (*Queue) DetachLooper

func (h *Queue) DetachLooper()

DetachLooper calls the underlying NDK function.

func (*Queue) FinishEvent

func (h *Queue) FinishEvent(event *Event, handled int32)

FinishEvent calls the underlying NDK function.

func (*Queue) GetEvent

func (h *Queue) GetEvent() *Event

GetEvent returns the next available input event from the queue. Returns nil if no events are available or an error occurred.

func (*Queue) HasEvents

func (h *Queue) HasEvents() error

HasEvents calls the underlying NDK function.

func (*Queue) Pointer

func (h *Queue) Pointer() unsafe.Pointer

Pointer returns the underlying pointer as unsafe.Pointer.

func (*Queue) PreDispatchEvent

func (h *Queue) PreDispatchEvent(event *Event) bool

PreDispatchEvent performs pre-dispatching of the given event. Returns true if the event was consumed by pre-dispatching (e.g. IME) and should NOT be passed to FinishEvent.

type Source

type Source int32
const (
	Unknown         Source = 0
	Keyboard        Source = 257
	Dpad            Source = 513
	Gamepad         Source = 1025
	Touchscreen     Source = 4098
	Mouse           Source = 8194
	Stylus          Source = 16386
	BluetoothStylus Source = 49154
	Trackball       Source = 65540
	MouseRelative   Source = 131076
	Touchpad        Source = 1048584
	TouchNavigation Source = 2097152
	Joystick        Source = 16777232
	Hdmi            Source = 33554433
	Sensor          Source = 67108864
	RotaryEncoder   Source = 4194304
	Any             Source = -256
)

func (Source) String

func (v Source) String() string

Jump to

Keyboard shortcuts

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