input

package
v1.0.0-rc9 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2022 License: BSD-2-Clause Imports: 2 Imported by: 6

Documentation

Overview

Package input provides type definitions for use with the Chrome Input protocol

https://chromedevtools.github.io/devtools-protocol/tot/Input/

Index

Constants

This section is empty.

Variables

View Source
var ButtonEvent = buttonEventEnum{
	None:   buttonEventNone,
	Left:   buttonEventLeft,
	Middle: buttonEventMiddle,
	Right:  buttonEventRight,
}

ButtonEvent provides named acces to the ButtonEventEnum values.

View Source
var KeyEvent = keyEventEnum{
	KeyDown:    keyEventKeyDown,
	KeyUp:      keyEventKeyUp,
	RawKeyDown: keyEventRawKeyDown,
	Char:       keyEventChar,
}

KeyEvent provides named acces to the KeyEventEnum values.

View Source
var MouseEvent = mouseEventEnum{
	MousePressed:  mouseEventMousePressed,
	MouseReleased: mouseEventMouseReleased,
	MouseMoved:    mouseEventMouseMoved,
	MouseWheel:    mouseEventMouseWheel,
}

MouseEvent provides named acces to the MouseEventEnum values.

View Source
var TouchEvent = touchEventEnum{
	TouchStart:  touchEventTouchStart,
	TouchEnd:    touchEventTouchEnd,
	TouchMove:   touchEventTouchMove,
	TouchCancel: touchEventTouchCancel,
}

TouchEvent provides named acces to the TouchEventEnum values.

Functions

This section is empty.

Types

type ButtonEventEnum

type ButtonEventEnum int

ButtonEventEnum represents the mouse button (default: "none"). Allowed values:

  • ButtonEvent.None "none"
  • ButtonEvent.Left "left"
  • ButtonEvent.Middle "middle"
  • ButtonEvent.Right "right"

https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-dispatchMouseEvent https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-emulateTouchFromMouseEvent

func (ButtonEventEnum) MarshalJSON

func (enum ButtonEventEnum) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (ButtonEventEnum) String

func (enum ButtonEventEnum) String() string

String implements Stringer

func (*ButtonEventEnum) UnmarshalJSON

func (enum *ButtonEventEnum) UnmarshalJSON(bytes []byte) error

UnmarshalJSON implements json.Unmarshaler

type DispatchKeyEventParams

type DispatchKeyEventParams struct {
	// Type of the key event. Allowed values:
	//	- KeyEvent.KeyDown
	//	- KeyEvent.KeyUp
	//	- KeyEvent.RawKeyDown
	//	- KeyEvent.Char
	Type KeyEventEnum `json:"type"`

	// Optional. Bit field representing pressed modifier keys. Alt=1, Ctrl=2,
	// Meta/Command=4, Shift=8 (default: 0).
	Modifiers int `json:"modifiers,omitempty"`

	// Optional. Time at which the event occurred.
	Timestamp TimeSinceEpoch `json:"timestamp,omitempty"`

	// Optional. Text as generated by processing a virtual key code with a
	// keyboard layout. Not needed for for `keyUp` and `rawKeyDown` events
	// (default: "").
	Text string `json:"text,omitempty"`

	// Optional. Text that would have been generated by the keyboard if no
	// modifiers were pressed (except for shift). Useful for shortcut
	// (accelerator) key handling (default: "").
	UnmodifiedText string `json:"unmodifiedText,omitempty"`

	// Optional. Unique key identifier (e.g., 'U+0041') (default: "").
	KeyIdentifier string `json:"keyIdentifier,omitempty"`

	// Optional. Unique DOM defined string value for each physical key (e.g.,
	// 'KeyA') (default: "").
	Code string `json:"code,omitempty"`

	// Optional. Unique DOM defined string value describing the meaning of the
	// key in the context of active modifiers, keyboard layout, etc (e.g.,
	// 'AltGr') (default: "").
	Key string `json:"key,omitempty"`

	// Optional. Windows virtual key code (default: 0).
	WindowsVirtualKeyCode int `json:"windowsVirtualKeyCode,omitempty"`

	// Optional. Native virtual key code (default: 0).
	NativeVirtualKeyCode int `json:"nativeVirtualKeyCode,omitempty"`

	// Optional. Whether the event was generated from auto repeat (default:
	// false).
	AutoRepeat bool `json:"autoRepeat,omitempty"`

	// Optional. Whether the event was generated from the keypad (default:
	// false).
	IsKeypad bool `json:"isKeypad,omitempty"`

	// Optional. Whether the event was a system key event (default: false).
	IsSystemKey bool `json:"isSystemKey,omitempty"`

	// Optional. Whether the event was from the left or right side of the
	// keyboard. 1=Left, 2=Right (default: 0).
	Location int `json:"location,omitempty"`
}

DispatchKeyEventParams represents Input.dispatchKeyEvent parameters.

https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-dispatchKeyEvent

type DispatchKeyEventResult

type DispatchKeyEventResult struct {
	// Error information related to executing this method
	Err error `json:"-"`
}

DispatchKeyEventResult represents the result of calls to Input.dispatchKeyEvent.

https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-dispatchKeyEvent

type DispatchMouseEventParams

type DispatchMouseEventParams struct {
	// Type of the mouse event. Allowed values:
	//	- MouseEvent.MousePressed
	//	- MouseEvent.MouseReleased
	//	- MouseEvent.MouseMoved
	//	- MouseEvent.MouseWheel
	Type MouseEventEnum `json:"type"`

	// X coordinate of the event relative to the main frame's viewport in CSS
	// pixels.
	X int `json:"x"`

	// 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.
	Y int `json:"y"`

	// Optional. Bit field representing pressed modifier keys. Alt=1, Ctrl=2,
	// Meta/Command=4, Shift=8 (default: 0).
	Modifiers int `json:"modifiers,omitempty"`

	// Optional. Time at which the event occurred.
	Timestamp TimeSinceEpoch `json:"timestamp,omitempty"`

	// Optional. Mouse button (default: "none"). Allowed values:
	//	- ButtonEvent.None
	//	- ButtonEvent.Left
	//	- ButtonEvent.Middle
	//	- ButtonEvent.Right
	Button ButtonEventEnum `json:"button,omitempty"`

	// Optional. Number of times the mouse button was clicked (default: 0).
	ClickCount int `json:"clickCount,omitempty"`

	// Optional. X delta in CSS pixels for mouse wheel event (default: 0).
	DeltaX int `json:"deltaX,omitempty"`

	// Optional. Y delta in CSS pixels for mouse wheel event (default: 0).
	DeltaY int `json:"deltaY,omitempty"`
}

DispatchMouseEventParams represents Input.dispatchMouseEvent parameters.

https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-dispatchMouseEvent

type DispatchMouseEventResult

type DispatchMouseEventResult struct {
	// Error information related to executing this method
	Err error `json:"-"`
}

DispatchMouseEventResult represents the result of calls to Input.dispatchMouseEvent.

https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-dispatchMouseEvent

type DispatchTouchEventParams

type DispatchTouchEventParams struct {
	// Type of the touch event. TouchEnd and TouchCancel must not contain any
	// touch points, while TouchStart and TouchMove must contains at least one.
	// Allowed values:
	//	- TouchEvent.TouchStart
	//	- TouchEvent.TouchEnd
	//	- TouchEvent.TouchMove
	//	- TouchEvent.TouchCancel
	Type TouchEventEnum `json:"type"`

	// 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.
	TouchPoints []*TouchPoint `json:"touchPoints"`

	// Optional. Bit field representing pressed modifier keys. Alt=1, Ctrl=2,
	// Meta/Command=4, Shift=8 (default: 0).
	Modifiers int `json:"modifiers,omitempty"`

	// Optional. Time at which the event occurred.
	Timestamp TimeSinceEpoch `json:"timestamp,omitempty"`
}

DispatchTouchEventParams represents Input.dispatchTouchEvent parameters.

https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-dispatchTouchEvent

type DispatchTouchEventResult

type DispatchTouchEventResult struct {
	// Error information related to executing this method
	Err error `json:"-"`
}

DispatchTouchEventResult represents the result of calls to Input.dispatchTouchEvent.

https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-dispatchTouchEvent

type EmulateTouchFromMouseEventParams

type EmulateTouchFromMouseEventParams struct {
	// Type of the mouse event. Allowed values:
	//	- MouseEvent.MousePressed
	//	- MouseEvent.MouseReleased
	//	- MouseEvent.MouseMoved
	//	- MouseEvent.MouseWheel
	Type MouseEventEnum `json:"type"`

	// X coordinate of the mouse pointer in DIP.
	X int `json:"x"`

	// Y coordinate of the mouse pointer in DIP.
	Y int `json:"y"`

	// Time at which the event occurred.
	Timestamp TimeSinceEpoch `json:"timestamp"`

	// Optional. Mouse button (default: "none"). Allowed values:
	//	- ButtonEvent.None
	//	- ButtonEvent.Left
	//	- ButtonEvent.Middle
	//	- ButtonEvent.Right
	Button ButtonEventEnum `json:"button"`

	// Optional. X delta in DIP for mouse wheel event (default: 0).
	DeltaX int `json:"deltaX,omitempty"`

	// Optional. Y delta in DIP for mouse wheel event (default: 0).
	DeltaY int `json:"deltaY,omitempty"`

	// Optional. Bit field representing pressed modifier keys. Alt=1, Ctrl=2,
	// Meta/Command=4, Shift=8 (default: 0).
	Modifiers int `json:"modifiers,omitempty"`

	// Optional. Number of times the mouse button was clicked (default: 0).
	ClickCount int `json:"clickCount,omitempty"`
}

EmulateTouchFromMouseEventParams represents Input.emulateTouchFromMouseEvent parameters.

https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-emulateTouchFromMouseEvent

type EmulateTouchFromMouseEventResult

type EmulateTouchFromMouseEventResult struct {
	// Error information related to executing this method
	Err error `json:"-"`
}

EmulateTouchFromMouseEventResult represents the result of calls to Input.emulateTouchFromMouseEvent.

https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-emulateTouchFromMouseEvent

type GestureSourceType

type GestureSourceType string

GestureSourceType is a gesture source type. EXPERIMENTAL

https://chromedevtools.github.io/devtools-protocol/tot/Input/#type-GestureSourceType

type KeyEventEnum

type KeyEventEnum int

KeyEventEnum represents the type of the key event. Allowed values:

  • KeyEvent.KeyDown "keyDown"
  • KeyEvent.KeyUp "keyUp"
  • KeyEvent.RawKeyDown "rawKeyDown"
  • KeyEvent.Char "char"

https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-dispatchKeyEvent

func (KeyEventEnum) MarshalJSON

func (enum KeyEventEnum) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (KeyEventEnum) String

func (enum KeyEventEnum) String() string

String implements Stringer

func (*KeyEventEnum) UnmarshalJSON

func (enum *KeyEventEnum) UnmarshalJSON(bytes []byte) error

UnmarshalJSON implements json.Unmarshaler

type MouseEventEnum

type MouseEventEnum int

MouseEventEnum represents the type of the mouse event. Allowed values:

  • MouseEvent.MousePressed "mousePressed"
  • MouseEvent.MouseReleased "mouseReleased"
  • MouseEvent.MouseMoved "mouseMoved"
  • MouseEvent.MouseWheel "mouseWheel"

https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-dispatchMouseEvent https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-emulateTouchFromMouseEvent

func (MouseEventEnum) MarshalJSON

func (enum MouseEventEnum) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (MouseEventEnum) String

func (enum MouseEventEnum) String() string

String implements Stringer

func (*MouseEventEnum) UnmarshalJSON

func (enum *MouseEventEnum) UnmarshalJSON(bytes []byte) error

UnmarshalJSON implements json.Unmarshaler

type SetIgnoreEventsParams

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

SetIgnoreEventsParams represents Input.setIgnoreInputEvents parameters.

https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-setIgnoreInputEvents

type SetIgnoreEventsResult

type SetIgnoreEventsResult struct {
	// Error information related to executing this method
	Err error `json:"-"`
}

SetIgnoreEventsResult represents the result of calls to Input.setIgnoreEvents.

https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-setIgnoreEvents

type SynthesizePinchGestureParams

type SynthesizePinchGestureParams struct {
	// X coordinate of the start of the gesture in CSS pixels.
	X float64 `json:"x"`

	// Y coordinate of the start of the gesture in CSS pixels.
	Y float64 `json:"y"`

	// Relative scale factor after zooming (>1.0 zooms in, <1.0 zooms out).
	ScaleFactor int `json:"scaleFactor"`

	// Optional. Relative pointer speed in pixels per second (default: 800).
	RelativeSpeed int `json:"relativeSpeed,omitempty"`

	// Optional. Which type of input events to be generated (default: 'default',
	// which queries the platform for the preferred input type).
	GestureSourceType GestureSourceType `json:"gestureSourceType,omitempty"`
}

SynthesizePinchGestureParams represents Input.synthesizePinchGesture parameters.

https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-synthesizePinchGesture

type SynthesizePinchGestureResult

type SynthesizePinchGestureResult struct {
	// Error information related to executing this method
	Err error `json:"-"`
}

SynthesizePinchGestureResult represents the result of calls to Input.synthesizePinchGesture.

https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-synthesizePinchGesture

type SynthesizeScrollGestureParams

type SynthesizeScrollGestureParams struct {
	// X coordinate of the start of the gesture in CSS pixels.
	X int `json:"x"`

	// Y coordinate of the start of the gesture in CSS pixels.
	Y int `json:"y"`

	// Optional. The distance to scroll along the X axis (positive to scroll
	// left).
	XDistance int `json:"xDistance,omitempty"`

	// Optional. The distance to scroll along the Y axis (positive to scroll up).
	YDistance int `json:"yDistance,omitempty"`

	// Optional. The number of additional pixels to scroll back along the X axis,
	// in addition to the given distance.
	XOverscroll int `json:"xOverscroll,omitempty"`

	// Optional. The number of additional pixels to scroll back along the Y axis,
	// in addition to the given distance.
	YOverscroll int `json:"yOverscroll,omitempty"`

	// Optional. Prevent fling (default: true).
	PreventFling bool `json:"preventFling,omitempty"`

	// Optional. Swipe speed in pixels per second (default: 800).
	Speed int `json:"speed,omitempty"`

	// Optional. Which type of input events to be generated (default: 'default',
	// which queries the platform for the preferred input type).
	GestureSourceType GestureSourceType `json:"gestureSourceType,omitempty"`

	// Optional. The number of times to repeat the gesture (default: 0).
	RepeatCount int `json:"repeatCount,omitempty"`

	// Optional. The number of milliseconds delay between each repeat. (default:
	// 250).
	RepeatDelayMs int `json:"repeatDelayMs,omitempty"`

	// Optional. The name of the interaction markers to generate, if not empty
	// (default: "").
	InteractionMarkerName string `json:"interactionMarkerName,omitempty"`
}

SynthesizeScrollGestureParams represents Input.synthesizeScrollGesture parameters.

https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-synthesizeScrollGesture

type SynthesizeScrollGestureResult

type SynthesizeScrollGestureResult struct {
	// Error information related to executing this method
	Err error `json:"-"`
}

SynthesizeScrollGestureResult represents the result of calls to Input.SynthesizeScrollGesture.

https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-SynthesizeScrollGesture

type SynthesizeTapGestureParams

type SynthesizeTapGestureParams struct {
	// X coordinate of the start of the gesture in CSS pixels.
	X int `json:"x"`

	// Y coordinate of the start of the gesture in CSS pixels.
	Y int `json:"y"`

	// Optional. Duration between touchdown and touchup events in ms (default:
	// 50).
	Duration int `json:"duration,omitempty"`

	// Optional. Number of times to perform the tap (e.g. 2 for double tap,
	// default: 1).
	TapCount int `json:"tapCount,omitempty"`

	// Optional. Which type of input events to be generated (default: 'default',
	// which queries the platform for the preferred input type).
	GestureSourceType GestureSourceType `json:"gestureSourceType,omitempty"`
}

SynthesizeTapGestureParams represents Input.synthesizeTapGesture parameters.

https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-synthesizeTapGesture

type SynthesizeTapGestureResult

type SynthesizeTapGestureResult struct {
	// Error information related to executing this method
	Err error `json:"-"`
}

SynthesizeTapGestureResult represents the result of calls to Input.SynthesizeTapGesture.

https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-SynthesizeTapGesture

type TimeSinceEpoch

type TimeSinceEpoch int

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

https://chromedevtools.github.io/devtools-protocol/tot/Input/#type-TimeSinceEpoch

type TouchEventEnum

type TouchEventEnum int

TouchEventEnum represents the type of the touch event. TouchEnd and TouchCancel must not contain any touch points, while TouchStart and TouchMove must contains at least one. Allowed values:

  • TouchEvent.TouchStart "touchStart"
  • TouchEvent.TouchEnd "touchEnd"
  • TouchEvent.TouchMove "touchMove"
  • TouchEvent.TouchCancel "touchCancel"

https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-dispatchMouseEvent

func (TouchEventEnum) MarshalJSON

func (enum TouchEventEnum) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (TouchEventEnum) String

func (enum TouchEventEnum) String() string

String implements Stringer

func (*TouchEventEnum) UnmarshalJSON

func (enum *TouchEventEnum) UnmarshalJSON(bytes []byte) error

UnmarshalJSON implements json.Unmarshaler

type TouchPoint

type TouchPoint struct {
	// X coordinate of the event relative to the main frame's viewport in CSS
	// pixels.
	X int `json:"x"`

	// 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.
	Y int `json:"y"`

	// Optional. X radius of the touch area (default: 1.0).
	RadiusX int `json:"radiusX,omitempty"`

	// Optional. Y radius of the touch area (default: 1.0).
	RadiusY int `json:"radiusY,omitempty"`

	// Optional. Rotation angle (default: 0.0).
	RotationAngle int `json:"rotationAngle,omitempty"`

	// Optional. Force (default: 1.0).
	Force int `json:"force,omitempty"`

	// Optional. Identifier used to track touch sources between events, must be
	// unique within an event.
	ID int `json:"id,omitempty"`
}

TouchPoint is a touch point.

https://chromedevtools.github.io/devtools-protocol/tot/Input/#type-TouchPoint

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳