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 UIGestureRecognizerStateBeganand the other values ofUIGestureRecognizerState.- key_
modifier_ flags - The bits of
UIKeyModifierFlags. - press_
phase UIPressPhaseBeganand the other values ofUIPressPhase.- press_
type UIPressTypeUpArrowand the other values ofUIPressTypethe handler knows.- touch_
phase UITouchPhaseBeganand the other values ofUITouchPhase.- touch_
type UITouchTypeDirectand the other values ofUITouchType.
Structs§
- Momentum
Scrolling - The state of scrolling: where it began, and the velocity of the inertia that follows it.
- Press
Key - What a press says of its key (
UIKey): the usage, the modifier flags and the characters. - Translated
Press - A press as the raw key event describes it.
Enums§
- Touch
Device Kind - 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_clicktells 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.