Skip to main content

Module input_handler

Module input_handler 

Source
Expand description

The input of a view: touches of fingers, of a pencil and of an indirect pointer become raw pointer events of the top-level, the presses of a keyboard or of a remote become raw key events and text, and the scroll events of a pointing device become wheel events that go on with inertia when the scrolling stops.

The swipe gestures of a remote, which the reference handles on tvOS only, are not ported (docs/porting/ios-platform.md).

Modules§

gesture_recognizer_state
UIGestureRecognizerStateBegan and the other values of UIGestureRecognizerState.
key_modifier_flags
The bits of UIKeyModifierFlags.
press_phase
UIPressPhaseBegan and the other values of UIPressPhase.
press_type
UIPressTypeUpArrow and the other values of UIPressType the handler knows.
touch_phase
UITouchPhaseBegan and the other values of UITouchPhase.
touch_type
UITouchTypeDirect and the other values of UITouchType.

Structs§

MomentumScrolling
The state of scrolling: where it began, and the velocity of the inertia that follows it.
PressKey
What a press says of its key (UIKey): the usage, the modifier flags and the characters.
TranslatedPress
A press as the raw key event describes it.

Enums§

TouchDeviceKind
The device a touch belongs to.

Constants§

DECELERATION_RATE
The rate the velocity of inertia scrolling falls by at every frame.
KEY_TABLE_USAGES
The usages of the key table.

Functions§

active_scroll_delta
The wheel delta of active scrolling at a velocity (points per second). A much more sensitive scaling than the one of inertia, to match AppKit: macOS uses small deltas, so the divisor is large.
convert_modifier_keys
The modifiers of UIKeyModifierFlags.
device_kind
The device of a touch of the given UITouchType; none for an indirect touch (the trackpad of a remote), which is handled with gestures.
is_final_phase
Whether a touch in the given phase is over.
key_event_type
The raw key event of a press in the given UIPressPhase.
physical_key_of_hid_usage
The physical key of a UIKeyboardHIDUsage, for the usages the table of the reference has.
pointer_event_type
The raw event of a touch of a device in the given UITouchPhase. is_right_click tells whether the secondary button is in the button mask of the event.
press_is_text_input
Whether a press that was not handled as a key is text: only when it began, and when it has characters.
pressure
The pressure of a touch. On iOS “1.0 represents the force of an average touch”, where the framework expects 0.5 for “average”. A touch whose maximum possible force is 0 has no force and gets the average.
translate_press
Translates a press: by its key when it has one that the key table knows (a keyboard, very likely), by its type otherwise (a remote, very likely).
ts
The timestamp of an event (seconds since the system started) in milliseconds; 0 without an event.