input

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2021 License: MIT Imports: 6 Imported by: 14

Documentation

Overview

Package input implements the Input domain.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(conn *rpcc.Conn) *domainClient

NewClient returns a client for the Input domain with the connection set to conn.

Types

type DispatchKeyEventArgs

type DispatchKeyEventArgs struct {
	// Type Type of the key event.
	//
	// Values: "keyDown", "keyUp", "rawKeyDown", "char".
	Type                  string         `json:"type"`
	Modifiers             *int           `json:"modifiers,omitempty"`             // Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
	Timestamp             TimeSinceEpoch `json:"timestamp,omitempty"`             // Time at which the event occurred.
	Text                  *string        `json:"text,omitempty"`                  // Text as generated by processing a virtual key code with a keyboard layout. Not needed for for `keyUp` and `rawKeyDown` events (default: "")
	UnmodifiedText        *string        `json:"unmodifiedText,omitempty"`        // Text that would have been generated by the keyboard if no modifiers were pressed (except for shift). Useful for shortcut (accelerator) key handling (default: "").
	KeyIdentifier         *string        `json:"keyIdentifier,omitempty"`         // Unique key identifier (e.g., 'U+0041') (default: "").
	Code                  *string        `json:"code,omitempty"`                  // Unique DOM defined string value for each physical key (e.g., 'KeyA') (default: "").
	Key                   *string        `json:"key,omitempty"`                   // Unique DOM defined string value describing the meaning of the key in the context of active modifiers, keyboard layout, etc (e.g., 'AltGr') (default: "").
	WindowsVirtualKeyCode *int           `json:"windowsVirtualKeyCode,omitempty"` // Windows virtual key code (default: 0).
	NativeVirtualKeyCode  *int           `json:"nativeVirtualKeyCode,omitempty"`  // Native virtual key code (default: 0).
	AutoRepeat            *bool          `json:"autoRepeat,omitempty"`            // Whether the event was generated from auto repeat (default: false).
	IsKeypad              *bool          `json:"isKeypad,omitempty"`              // Whether the event was generated from the keypad (default: false).
	IsSystemKey           *bool          `json:"isSystemKey,omitempty"`           // Whether the event was a system key event (default: false).
	Location              *int           `json:"location,omitempty"`              // Whether the event was from the left or right side of the keyboard. 1=Left, 2=Right (default: 0).
	// Commands Editing commands to send with the key event (e.g.,
	// 'selectAll') (default: []). These are related to but not equal the
	// command names used in `document.execCommand` and
	// NSStandardKeyBindingResponding. See
	// https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/editing/commands/editor_command_names.h
	// for valid command names.
	//
	// Note: This property is experimental.
	Commands []string `json:"commands,omitempty"`
}

DispatchKeyEventArgs represents the arguments for DispatchKeyEvent in the Input domain.

func NewDispatchKeyEventArgs

func NewDispatchKeyEventArgs(typ string) *DispatchKeyEventArgs

NewDispatchKeyEventArgs initializes DispatchKeyEventArgs with the required arguments.

func (*DispatchKeyEventArgs) SetAutoRepeat

func (a *DispatchKeyEventArgs) SetAutoRepeat(autoRepeat bool) *DispatchKeyEventArgs

SetAutoRepeat sets the AutoRepeat optional argument. Whether the event was generated from auto repeat (default: false).

func (*DispatchKeyEventArgs) SetCode

SetCode sets the Code optional argument. Unique DOM defined string value for each physical key (e.g., 'KeyA') (default: "").

func (*DispatchKeyEventArgs) SetCommands added in v0.31.0

func (a *DispatchKeyEventArgs) SetCommands(commands []string) *DispatchKeyEventArgs

SetCommands sets the Commands optional argument. Editing commands to send with the key event (e.g., 'selectAll') (default: []). These are related to but not equal the command names used in `document.execCommand` and NSStandardKeyBindingResponding. See https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/editing/commands/editor_command_names.h for valid command names.

Note: This property is experimental.

func (*DispatchKeyEventArgs) SetIsKeypad

func (a *DispatchKeyEventArgs) SetIsKeypad(isKeypad bool) *DispatchKeyEventArgs

SetIsKeypad sets the IsKeypad optional argument. Whether the event was generated from the keypad (default: false).

func (*DispatchKeyEventArgs) SetIsSystemKey

func (a *DispatchKeyEventArgs) SetIsSystemKey(isSystemKey bool) *DispatchKeyEventArgs

SetIsSystemKey sets the IsSystemKey optional argument. Whether the event was a system key event (default: false).

func (*DispatchKeyEventArgs) SetKey

SetKey sets the Key optional argument. Unique DOM defined string value describing the meaning of the key in the context of active modifiers, keyboard layout, etc (e.g., 'AltGr') (default: "").

func (*DispatchKeyEventArgs) SetKeyIdentifier

func (a *DispatchKeyEventArgs) SetKeyIdentifier(keyIdentifier string) *DispatchKeyEventArgs

SetKeyIdentifier sets the KeyIdentifier optional argument. Unique key identifier (e.g., 'U+0041') (default: "").

func (*DispatchKeyEventArgs) SetLocation added in v0.14.1

func (a *DispatchKeyEventArgs) SetLocation(location int) *DispatchKeyEventArgs

SetLocation sets the Location optional argument. Whether the event was from the left or right side of the keyboard. 1=Left, 2=Right (default: 0).

func (*DispatchKeyEventArgs) SetModifiers

func (a *DispatchKeyEventArgs) SetModifiers(modifiers int) *DispatchKeyEventArgs

SetModifiers sets the Modifiers optional argument. Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).

func (*DispatchKeyEventArgs) SetNativeVirtualKeyCode

func (a *DispatchKeyEventArgs) SetNativeVirtualKeyCode(nativeVirtualKeyCode int) *DispatchKeyEventArgs

SetNativeVirtualKeyCode sets the NativeVirtualKeyCode optional argument. Native virtual key code (default: 0).

func (*DispatchKeyEventArgs) SetText

SetText sets the Text optional argument. Text as generated by processing a virtual key code with a keyboard layout. Not needed for for `keyUp` and `rawKeyDown` events (default: "")

func (*DispatchKeyEventArgs) SetTimestamp

func (a *DispatchKeyEventArgs) SetTimestamp(timestamp TimeSinceEpoch) *DispatchKeyEventArgs

SetTimestamp sets the Timestamp optional argument. Time at which the event occurred.

func (*DispatchKeyEventArgs) SetUnmodifiedText

func (a *DispatchKeyEventArgs) SetUnmodifiedText(unmodifiedText string) *DispatchKeyEventArgs

SetUnmodifiedText sets the UnmodifiedText optional argument. Text that would have been generated by the keyboard if no modifiers were pressed (except for shift). Useful for shortcut (accelerator) key handling (default: "").

func (*DispatchKeyEventArgs) SetWindowsVirtualKeyCode

func (a *DispatchKeyEventArgs) SetWindowsVirtualKeyCode(windowsVirtualKeyCode int) *DispatchKeyEventArgs

SetWindowsVirtualKeyCode sets the WindowsVirtualKeyCode optional argument. Windows virtual key code (default: 0).

type DispatchMouseEventArgs

type DispatchMouseEventArgs struct {
	// Type Type of the mouse event.
	//
	// Values: "mousePressed", "mouseReleased", "mouseMoved", "mouseWheel".
	Type       string         `json:"type"`
	X          float64        `json:"x"`                    // X coordinate of the event relative to the main frame's viewport in CSS pixels.
	Y          float64        `json:"y"`                    // Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport.
	Modifiers  *int           `json:"modifiers,omitempty"`  // Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
	Timestamp  TimeSinceEpoch `json:"timestamp,omitempty"`  // Time at which the event occurred.
	Button     MouseButton    `json:"button,omitempty"`     // Mouse button (default: "none").
	Buttons    *int           `json:"buttons,omitempty"`    // A number indicating which buttons are pressed on the mouse when a mouse event is triggered. Left=1, Right=2, Middle=4, Back=8, Forward=16, None=0.
	ClickCount *int           `json:"clickCount,omitempty"` // Number of times the mouse button was clicked (default: 0).
	// Force The normalized pressure, which has a range of [0,1] (default:
	// 0).
	//
	// Note: This property is experimental.
	Force *float64 `json:"force,omitempty"`
	// TangentialPressure The normalized tangential pressure, which has a
	// range of [-1,1] (default: 0).
	//
	// Note: This property is experimental.
	TangentialPressure *float64 `json:"tangentialPressure,omitempty"`
	// TiltX The plane angle between the Y-Z plane and the plane
	// containing both the stylus axis and the Y axis, in degrees of the
	// range [-90,90], a positive tiltX is to the right (default: 0).
	//
	// Note: This property is experimental.
	TiltX *int `json:"tiltX,omitempty"`
	// TiltY The plane angle between the X-Z plane and the plane
	// containing both the stylus axis and the X axis, in degrees of the
	// range [-90,90], a positive tiltY is towards the user (default: 0).
	//
	// Note: This property is experimental.
	TiltY *int `json:"tiltY,omitempty"`
	// Twist The clockwise rotation of a pen stylus around its own major
	// axis, in degrees in the range [0,359] (default: 0).
	//
	// Note: This property is experimental.
	Twist  *int     `json:"twist,omitempty"`
	DeltaX *float64 `json:"deltaX,omitempty"` // X delta in CSS pixels for mouse wheel event (default: 0).
	DeltaY *float64 `json:"deltaY,omitempty"` // Y delta in CSS pixels for mouse wheel event (default: 0).
	// PointerType Pointer type (default: "mouse").
	//
	// Values: "mouse", "pen".
	PointerType *string `json:"pointerType,omitempty"`
}

DispatchMouseEventArgs represents the arguments for DispatchMouseEvent in the Input domain.

func NewDispatchMouseEventArgs

func NewDispatchMouseEventArgs(typ string, x float64, y float64) *DispatchMouseEventArgs

NewDispatchMouseEventArgs initializes DispatchMouseEventArgs with the required arguments.

func (*DispatchMouseEventArgs) SetButton

SetButton sets the Button optional argument. Mouse button (default: "none").

func (*DispatchMouseEventArgs) SetButtons added in v0.21.0

func (a *DispatchMouseEventArgs) SetButtons(buttons int) *DispatchMouseEventArgs

SetButtons sets the Buttons optional argument. A number indicating which buttons are pressed on the mouse when a mouse event is triggered. Left=1, Right=2, Middle=4, Back=8, Forward=16, None=0.

func (*DispatchMouseEventArgs) SetClickCount

func (a *DispatchMouseEventArgs) SetClickCount(clickCount int) *DispatchMouseEventArgs

SetClickCount sets the ClickCount optional argument. Number of times the mouse button was clicked (default: 0).

func (*DispatchMouseEventArgs) SetDeltaX added in v0.11.1

SetDeltaX sets the DeltaX optional argument. X delta in CSS pixels for mouse wheel event (default: 0).

func (*DispatchMouseEventArgs) SetDeltaY added in v0.11.1

SetDeltaY sets the DeltaY optional argument. Y delta in CSS pixels for mouse wheel event (default: 0).

func (*DispatchMouseEventArgs) SetForce added in v0.31.0

SetForce sets the Force optional argument. The normalized pressure, which has a range of [0,1] (default: 0).

Note: This property is experimental.

func (*DispatchMouseEventArgs) SetModifiers

func (a *DispatchMouseEventArgs) SetModifiers(modifiers int) *DispatchMouseEventArgs

SetModifiers sets the Modifiers optional argument. Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).

func (*DispatchMouseEventArgs) SetPointerType added in v0.21.0

func (a *DispatchMouseEventArgs) SetPointerType(pointerType string) *DispatchMouseEventArgs

SetPointerType sets the PointerType optional argument. Pointer type (default: "mouse").

Values: "mouse", "pen".

func (*DispatchMouseEventArgs) SetTangentialPressure added in v0.31.0

func (a *DispatchMouseEventArgs) SetTangentialPressure(tangentialPressure float64) *DispatchMouseEventArgs

SetTangentialPressure sets the TangentialPressure optional argument. The normalized tangential pressure, which has a range of [-1,1] (default: 0).

Note: This property is experimental.

func (*DispatchMouseEventArgs) SetTiltX added in v0.31.0

SetTiltX sets the TiltX optional argument. The plane angle between the Y-Z plane and the plane containing both the stylus axis and the Y axis, in degrees of the range [-90,90], a positive tiltX is to the right (default: 0).

Note: This property is experimental.

func (*DispatchMouseEventArgs) SetTiltY added in v0.31.0

SetTiltY sets the TiltY optional argument. The plane angle between the X-Z plane and the plane containing both the stylus axis and the X axis, in degrees of the range [-90,90], a positive tiltY is towards the user (default: 0).

Note: This property is experimental.

func (*DispatchMouseEventArgs) SetTimestamp

func (a *DispatchMouseEventArgs) SetTimestamp(timestamp TimeSinceEpoch) *DispatchMouseEventArgs

SetTimestamp sets the Timestamp optional argument. Time at which the event occurred.

func (*DispatchMouseEventArgs) SetTwist added in v0.31.0

SetTwist sets the Twist optional argument. The clockwise rotation of a pen stylus around its own major axis, in degrees in the range [0,359] (default: 0).

Note: This property is experimental.

type DispatchTouchEventArgs

type DispatchTouchEventArgs struct {
	// Type Type of the touch event. TouchEnd and TouchCancel must not
	// contain any touch points, while TouchStart and TouchMove must
	// contains at least one.
	//
	// Values: "touchStart", "touchEnd", "touchMove", "touchCancel".
	Type        string         `json:"type"`
	TouchPoints []TouchPoint   `json:"touchPoints"`         // Active touch points on the touch device. One event per any changed point (compared to previous touch event in a sequence) is generated, emulating pressing/moving/releasing points one by one.
	Modifiers   *int           `json:"modifiers,omitempty"` // Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
	Timestamp   TimeSinceEpoch `json:"timestamp,omitempty"` // Time at which the event occurred.
}

DispatchTouchEventArgs represents the arguments for DispatchTouchEvent in the Input domain.

func NewDispatchTouchEventArgs

func NewDispatchTouchEventArgs(typ string, touchPoints []TouchPoint) *DispatchTouchEventArgs

NewDispatchTouchEventArgs initializes DispatchTouchEventArgs with the required arguments.

func (*DispatchTouchEventArgs) SetModifiers

func (a *DispatchTouchEventArgs) SetModifiers(modifiers int) *DispatchTouchEventArgs

SetModifiers sets the Modifiers optional argument. Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).

func (*DispatchTouchEventArgs) SetTimestamp

func (a *DispatchTouchEventArgs) SetTimestamp(timestamp TimeSinceEpoch) *DispatchTouchEventArgs

SetTimestamp sets the Timestamp optional argument. Time at which the event occurred.

type EmulateTouchFromMouseEventArgs

type EmulateTouchFromMouseEventArgs struct {
	// Type Type of the mouse event.
	//
	// Values: "mousePressed", "mouseReleased", "mouseMoved", "mouseWheel".
	Type       string         `json:"type"`
	X          int            `json:"x"`                    // X coordinate of the mouse pointer in DIP.
	Y          int            `json:"y"`                    // Y coordinate of the mouse pointer in DIP.
	Button     MouseButton    `json:"button"`               // Mouse button. Only "none", "left", "right" are supported.
	Timestamp  TimeSinceEpoch `json:"timestamp,omitempty"`  // Time at which the event occurred (default: current time).
	DeltaX     *float64       `json:"deltaX,omitempty"`     // X delta in DIP for mouse wheel event (default: 0).
	DeltaY     *float64       `json:"deltaY,omitempty"`     // Y delta in DIP for mouse wheel event (default: 0).
	Modifiers  *int           `json:"modifiers,omitempty"`  // Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
	ClickCount *int           `json:"clickCount,omitempty"` // Number of times the mouse button was clicked (default: 0).
}

EmulateTouchFromMouseEventArgs represents the arguments for EmulateTouchFromMouseEvent in the Input domain.

func NewEmulateTouchFromMouseEventArgs

func NewEmulateTouchFromMouseEventArgs(typ string, x int, y int, button MouseButton) *EmulateTouchFromMouseEventArgs

NewEmulateTouchFromMouseEventArgs initializes EmulateTouchFromMouseEventArgs with the required arguments.

func (*EmulateTouchFromMouseEventArgs) SetClickCount

SetClickCount sets the ClickCount optional argument. Number of times the mouse button was clicked (default: 0).

func (*EmulateTouchFromMouseEventArgs) SetDeltaX

SetDeltaX sets the DeltaX optional argument. X delta in DIP for mouse wheel event (default: 0).

func (*EmulateTouchFromMouseEventArgs) SetDeltaY

SetDeltaY sets the DeltaY optional argument. Y delta in DIP for mouse wheel event (default: 0).

func (*EmulateTouchFromMouseEventArgs) SetModifiers

SetModifiers sets the Modifiers optional argument. Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).

func (*EmulateTouchFromMouseEventArgs) SetTimestamp added in v0.16.1

SetTimestamp sets the Timestamp optional argument. Time at which the event occurred (default: current time).

type GestureSourceType

type GestureSourceType string

GestureSourceType

Note: This type is experimental.

const (
	GestureSourceTypeNotSet  GestureSourceType = ""
	GestureSourceTypeDefault GestureSourceType = "default"
	GestureSourceTypeTouch   GestureSourceType = "touch"
	GestureSourceTypeMouse   GestureSourceType = "mouse"
)

GestureSourceType as enums.

func (GestureSourceType) String

func (e GestureSourceType) String() string

func (GestureSourceType) Valid

func (e GestureSourceType) Valid() bool

type InsertTextArgs added in v0.18.6

type InsertTextArgs struct {
	Text string `json:"text"` // The text to insert.
}

InsertTextArgs represents the arguments for InsertText in the Input domain.

func NewInsertTextArgs added in v0.18.6

func NewInsertTextArgs(text string) *InsertTextArgs

NewInsertTextArgs initializes InsertTextArgs with the required arguments.

type MouseButton added in v0.26.0

type MouseButton string

MouseButton

const (
	MouseButtonNotSet  MouseButton = ""
	MouseButtonNone    MouseButton = "none"
	MouseButtonLeft    MouseButton = "left"
	MouseButtonMiddle  MouseButton = "middle"
	MouseButtonRight   MouseButton = "right"
	MouseButtonBack    MouseButton = "back"
	MouseButtonForward MouseButton = "forward"
)

MouseButton as enums.

func (MouseButton) String added in v0.26.0

func (e MouseButton) String() string

func (MouseButton) Valid added in v0.26.0

func (e MouseButton) Valid() bool

type SetIgnoreInputEventsArgs

type SetIgnoreInputEventsArgs struct {
	Ignore bool `json:"ignore"` // Ignores input events processing when set to true.
}

SetIgnoreInputEventsArgs represents the arguments for SetIgnoreInputEvents in the Input domain.

func NewSetIgnoreInputEventsArgs

func NewSetIgnoreInputEventsArgs(ignore bool) *SetIgnoreInputEventsArgs

NewSetIgnoreInputEventsArgs initializes SetIgnoreInputEventsArgs with the required arguments.

type SynthesizePinchGestureArgs

type SynthesizePinchGestureArgs struct {
	X                 float64           `json:"x"`                           // X coordinate of the start of the gesture in CSS pixels.
	Y                 float64           `json:"y"`                           // Y coordinate of the start of the gesture in CSS pixels.
	ScaleFactor       float64           `json:"scaleFactor"`                 // Relative scale factor after zooming (>1.0 zooms in, <1.0 zooms out).
	RelativeSpeed     *int              `json:"relativeSpeed,omitempty"`     // Relative pointer speed in pixels per second (default: 800).
	GestureSourceType GestureSourceType `json:"gestureSourceType,omitempty"` // Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type).
}

SynthesizePinchGestureArgs represents the arguments for SynthesizePinchGesture in the Input domain.

func NewSynthesizePinchGestureArgs

func NewSynthesizePinchGestureArgs(x float64, y float64, scaleFactor float64) *SynthesizePinchGestureArgs

NewSynthesizePinchGestureArgs initializes SynthesizePinchGestureArgs with the required arguments.

func (*SynthesizePinchGestureArgs) SetGestureSourceType

func (a *SynthesizePinchGestureArgs) SetGestureSourceType(gestureSourceType GestureSourceType) *SynthesizePinchGestureArgs

SetGestureSourceType sets the GestureSourceType optional argument. Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type).

func (*SynthesizePinchGestureArgs) SetRelativeSpeed

func (a *SynthesizePinchGestureArgs) SetRelativeSpeed(relativeSpeed int) *SynthesizePinchGestureArgs

SetRelativeSpeed sets the RelativeSpeed optional argument. Relative pointer speed in pixels per second (default: 800).

type SynthesizeScrollGestureArgs

type SynthesizeScrollGestureArgs struct {
	X                     float64           `json:"x"`                               // X coordinate of the start of the gesture in CSS pixels.
	Y                     float64           `json:"y"`                               // Y coordinate of the start of the gesture in CSS pixels.
	XDistance             *float64          `json:"xDistance,omitempty"`             // The distance to scroll along the X axis (positive to scroll left).
	YDistance             *float64          `json:"yDistance,omitempty"`             // The distance to scroll along the Y axis (positive to scroll up).
	XOverscroll           *float64          `json:"xOverscroll,omitempty"`           // The number of additional pixels to scroll back along the X axis, in addition to the given distance.
	YOverscroll           *float64          `json:"yOverscroll,omitempty"`           // The number of additional pixels to scroll back along the Y axis, in addition to the given distance.
	PreventFling          *bool             `json:"preventFling,omitempty"`          // Prevent fling (default: true).
	Speed                 *int              `json:"speed,omitempty"`                 // Swipe speed in pixels per second (default: 800).
	GestureSourceType     GestureSourceType `json:"gestureSourceType,omitempty"`     // Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type).
	RepeatCount           *int              `json:"repeatCount,omitempty"`           // The number of times to repeat the gesture (default: 0).
	RepeatDelayMs         *int              `json:"repeatDelayMs,omitempty"`         // The number of milliseconds delay between each repeat. (default: 250).
	InteractionMarkerName *string           `json:"interactionMarkerName,omitempty"` // The name of the interaction markers to generate, if not empty (default: "").
}

SynthesizeScrollGestureArgs represents the arguments for SynthesizeScrollGesture in the Input domain.

func NewSynthesizeScrollGestureArgs

func NewSynthesizeScrollGestureArgs(x float64, y float64) *SynthesizeScrollGestureArgs

NewSynthesizeScrollGestureArgs initializes SynthesizeScrollGestureArgs with the required arguments.

func (*SynthesizeScrollGestureArgs) SetGestureSourceType

func (a *SynthesizeScrollGestureArgs) SetGestureSourceType(gestureSourceType GestureSourceType) *SynthesizeScrollGestureArgs

SetGestureSourceType sets the GestureSourceType optional argument. Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type).

func (*SynthesizeScrollGestureArgs) SetInteractionMarkerName

func (a *SynthesizeScrollGestureArgs) SetInteractionMarkerName(interactionMarkerName string) *SynthesizeScrollGestureArgs

SetInteractionMarkerName sets the InteractionMarkerName optional argument. The name of the interaction markers to generate, if not empty (default: "").

func (*SynthesizeScrollGestureArgs) SetPreventFling

func (a *SynthesizeScrollGestureArgs) SetPreventFling(preventFling bool) *SynthesizeScrollGestureArgs

SetPreventFling sets the PreventFling optional argument. Prevent fling (default: true).

func (*SynthesizeScrollGestureArgs) SetRepeatCount

func (a *SynthesizeScrollGestureArgs) SetRepeatCount(repeatCount int) *SynthesizeScrollGestureArgs

SetRepeatCount sets the RepeatCount optional argument. The number of times to repeat the gesture (default: 0).

func (*SynthesizeScrollGestureArgs) SetRepeatDelayMs

func (a *SynthesizeScrollGestureArgs) SetRepeatDelayMs(repeatDelayMs int) *SynthesizeScrollGestureArgs

SetRepeatDelayMs sets the RepeatDelayMs optional argument. The number of milliseconds delay between each repeat. (default: 250).

func (*SynthesizeScrollGestureArgs) SetSpeed

SetSpeed sets the Speed optional argument. Swipe speed in pixels per second (default: 800).

func (*SynthesizeScrollGestureArgs) SetXDistance

SetXDistance sets the XDistance optional argument. The distance to scroll along the X axis (positive to scroll left).

func (*SynthesizeScrollGestureArgs) SetXOverscroll

func (a *SynthesizeScrollGestureArgs) SetXOverscroll(xOverscroll float64) *SynthesizeScrollGestureArgs

SetXOverscroll sets the XOverscroll optional argument. The number of additional pixels to scroll back along the X axis, in addition to the given distance.

func (*SynthesizeScrollGestureArgs) SetYDistance

SetYDistance sets the YDistance optional argument. The distance to scroll along the Y axis (positive to scroll up).

func (*SynthesizeScrollGestureArgs) SetYOverscroll

func (a *SynthesizeScrollGestureArgs) SetYOverscroll(yOverscroll float64) *SynthesizeScrollGestureArgs

SetYOverscroll sets the YOverscroll optional argument. The number of additional pixels to scroll back along the Y axis, in addition to the given distance.

type SynthesizeTapGestureArgs

type SynthesizeTapGestureArgs struct {
	X                 float64           `json:"x"`                           // X coordinate of the start of the gesture in CSS pixels.
	Y                 float64           `json:"y"`                           // Y coordinate of the start of the gesture in CSS pixels.
	Duration          *int              `json:"duration,omitempty"`          // Duration between touchdown and touchup events in ms (default: 50).
	TapCount          *int              `json:"tapCount,omitempty"`          // Number of times to perform the tap (e.g. 2 for double tap, default: 1).
	GestureSourceType GestureSourceType `json:"gestureSourceType,omitempty"` // Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type).
}

SynthesizeTapGestureArgs represents the arguments for SynthesizeTapGesture in the Input domain.

func NewSynthesizeTapGestureArgs

func NewSynthesizeTapGestureArgs(x float64, y float64) *SynthesizeTapGestureArgs

NewSynthesizeTapGestureArgs initializes SynthesizeTapGestureArgs with the required arguments.

func (*SynthesizeTapGestureArgs) SetDuration

func (a *SynthesizeTapGestureArgs) SetDuration(duration int) *SynthesizeTapGestureArgs

SetDuration sets the Duration optional argument. Duration between touchdown and touchup events in ms (default: 50).

func (*SynthesizeTapGestureArgs) SetGestureSourceType

func (a *SynthesizeTapGestureArgs) SetGestureSourceType(gestureSourceType GestureSourceType) *SynthesizeTapGestureArgs

SetGestureSourceType sets the GestureSourceType optional argument. Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type).

func (*SynthesizeTapGestureArgs) SetTapCount

func (a *SynthesizeTapGestureArgs) SetTapCount(tapCount int) *SynthesizeTapGestureArgs

SetTapCount sets the TapCount optional argument. Number of times to perform the tap (e.g. 2 for double tap, default: 1).

type TimeSinceEpoch

type TimeSinceEpoch float64

TimeSinceEpoch UTC time in seconds, counted from January 1, 1970.

func (TimeSinceEpoch) MarshalJSON

func (t TimeSinceEpoch) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. Encodes to null if t is zero.

func (TimeSinceEpoch) String

func (t TimeSinceEpoch) String() string

String calls (time.Time).String().

func (TimeSinceEpoch) Time

func (t TimeSinceEpoch) Time() time.Time

Time parses the Unix time.

func (*TimeSinceEpoch) UnmarshalJSON

func (t *TimeSinceEpoch) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type TouchPoint

type TouchPoint struct {
	X             float64  `json:"x"`                       // X coordinate of the event relative to the main frame's viewport in CSS pixels.
	Y             float64  `json:"y"`                       // Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport.
	RadiusX       *float64 `json:"radiusX,omitempty"`       // X radius of the touch area (default: 1.0).
	RadiusY       *float64 `json:"radiusY,omitempty"`       // Y radius of the touch area (default: 1.0).
	RotationAngle *float64 `json:"rotationAngle,omitempty"` // Rotation angle (default: 0.0).
	Force         *float64 `json:"force,omitempty"`         // Force (default: 1.0).
	// TangentialPressure The normalized tangential pressure, which has a
	// range of [-1,1] (default: 0).
	//
	// Note: This property is experimental.
	TangentialPressure *float64 `json:"tangentialPressure,omitempty"`
	// TiltX The plane angle between the Y-Z plane and the plane
	// containing both the stylus axis and the Y axis, in degrees of the
	// range [-90,90], a positive tiltX is to the right (default: 0)
	//
	// Note: This property is experimental.
	TiltX *int `json:"tiltX,omitempty"`
	// TiltY The plane angle between the X-Z plane and the plane
	// containing both the stylus axis and the X axis, in degrees of the
	// range [-90,90], a positive tiltY is towards the user (default: 0).
	//
	// Note: This property is experimental.
	TiltY *int `json:"tiltY,omitempty"`
	// Twist The clockwise rotation of a pen stylus around its own major
	// axis, in degrees in the range [0,359] (default: 0).
	//
	// Note: This property is experimental.
	Twist *int     `json:"twist,omitempty"`
	ID    *float64 `json:"id,omitempty"` // Identifier used to track touch sources between events, must be unique within an event.
}

TouchPoint

Jump to

Keyboard shortcuts

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