Scoop API

scoop:scoop.surface:0.1.0

src/shared/input/events.scoop

Selected production source · src/shared/input/events.scoop

1package scoop.surface
3import scoop.window.*
5/** Native state is retained; time can describe a later geometry-driven hover transition. */
6public struct InputPointer(val state: PointerState, val time: InputTime)
8public enum InputCancelReason {
9 Window(
10 PointerCancelReason
11 ), AreaChanged, BoundaryChanged, ScrollInterrupted, GestureInterrupted, ContactInterrupted, Claimed, ClaimCancelled, Closed
14/** Pixel distances are logical; line distances retain their native unit. */
15public enum InputScrollDelta {
16 Lines(Double, Double), Pixels(Double, Double)
19public enum InputPointerEvent {
20 Entered(InputPointer), Left(InputTime), Moved(InputPointer),
21 Button(InputPointer, MouseButton, ElementState, Int),
22 Wheel(InputPointer, InputScrollDelta, ScrollPhase, ScrollPhase),
23 Cancelled(InputCancelReason, InputTime), ScrollCancelled(InputCancelReason, InputTime)
26/** Native recognition and route cancellation share the ordinary input path. */
27public enum InputGestureEvent {
28 Native(GestureEvent), Cancelled(GestureKind, InputCancelReason, InputTime)
31public enum InputContactEvent {
32 Began(ContactState), Moved(ContactState), Ended(ContactState),
33 Cancelled(ContactId, InputCancelReason, InputTime)
36public enum InputPressSource {
37 Mouse(InputPointer, MouseButton, Int), Contact(ContactState)
40/** Snapshot before the current input domain starts delivering a press. */
41public struct InputPress(val target: InputScope, val source: InputPressSource)
43/** Text transactions and focus/hover transitions are delivered directly to their owner. */
44public enum InputEvent {
45 Pointer(InputPointerEvent), Contact(InputContactEvent), Gesture(InputGestureEvent), Keyboard(
46 KeyEvent
47 ), TextCommand(TextEditCommand), ModifiersChanged(Modifiers),
48 TextInput(TextInputEvent), FocusChanged(Boolean), FocusVisibilityChanged(Boolean)
51public enum FocusOrigin {
52 Pointer, Keyboard, Programmatic
55public enum FocusVisibility {
56 Automatic, Always, Never
59public enum RoutedPhase {
60 Capture, Target, Bubble, Default, Notification