Source File
input.go
Belonging Package
github.com/chromedp/cdproto/input
// Package input provides the Chrome DevTools Protocol// commands, types, and events for the Input domain.//// Generated by the cdproto-gen command.package input// Code generated by cdproto-gen. DO NOT EDIT.import ()// DispatchDragEventParams dispatches a drag event into the page.type DispatchDragEventParams struct {Type DispatchDragEventType `json:"type"` // Type of the drag event.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.Data *DragData `json:"data"`Modifiers Modifier `json:"modifiers"` // Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).}// DispatchDragEvent dispatches a drag event into the page.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Input#method-dispatchDragEvent//// parameters://// type - Type of the drag event.// x - X coordinate of the event relative to the main frame's viewport in CSS pixels.// 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.// datafunc ( DispatchDragEventType, float64, float64, *DragData) *DispatchDragEventParams {return &DispatchDragEventParams{Type: ,X: ,Y: ,Data: ,}}// WithModifiers bit field representing pressed modifier keys. Alt=1, Ctrl=2,// Meta/Command=4, Shift=8 (default: 0).func ( DispatchDragEventParams) ( Modifier) *DispatchDragEventParams {.Modifiers =return &}// Do executes Input.dispatchDragEvent against the provided context.func ( *DispatchDragEventParams) ( context.Context) ( error) {return cdp.Execute(, CommandDispatchDragEvent, , nil)}// DispatchKeyEventParams dispatches a key event to the page.type DispatchKeyEventParams struct {Type KeyType `json:"type"` // Type of the key event.Modifiers Modifier `json:"modifiers"` // 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 int64 `json:"windowsVirtualKeyCode,omitempty"` // Windows virtual key code (default: 0).NativeVirtualKeyCode int64 `json:"nativeVirtualKeyCode,omitempty"` // Native virtual key code (default: 0).AutoRepeat bool `json:"autoRepeat"` // Whether the event was generated from auto repeat (default: false).IsKeypad bool `json:"isKeypad"` // Whether the event was generated from the keypad (default: false).IsSystemKey bool `json:"isSystemKey"` // Whether the event was a system key event (default: false).Location int64 `json:"location,omitempty"` // Whether the event was from the left or right side of the keyboard. 1=Left, 2=Right (default: 0).Commands []string `json:"commands,omitempty"` // 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/+/main:third_party/blink/renderer/core/editing/commands/editor_command_names.h for valid command names.}// DispatchKeyEvent dispatches a key event to the page.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Input#method-dispatchKeyEvent//// parameters://// type - Type of the key event.func ( KeyType) *DispatchKeyEventParams {return &DispatchKeyEventParams{Type: ,}}// WithModifiers bit field representing pressed modifier keys. Alt=1, Ctrl=2,// Meta/Command=4, Shift=8 (default: 0).func ( DispatchKeyEventParams) ( Modifier) *DispatchKeyEventParams {.Modifiers =return &}// WithTimestamp time at which the event occurred.func ( DispatchKeyEventParams) ( *TimeSinceEpoch) *DispatchKeyEventParams {.Timestamp =return &}// WithText text as generated by processing a virtual key code with a// keyboard layout. Not needed for for keyUp and rawKeyDown events (default:// "").func ( DispatchKeyEventParams) ( string) *DispatchKeyEventParams {.Text =return &}// WithUnmodifiedText 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 ( DispatchKeyEventParams) ( string) *DispatchKeyEventParams {.UnmodifiedText =return &}// WithKeyIdentifier unique key identifier (e.g., 'U+0041') (default: "").func ( DispatchKeyEventParams) ( string) *DispatchKeyEventParams {.KeyIdentifier =return &}// WithCode unique DOM defined string value for each physical key (e.g.,// 'KeyA') (default: "").func ( DispatchKeyEventParams) ( string) *DispatchKeyEventParams {.Code =return &}// WithKey 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 ( DispatchKeyEventParams) ( string) *DispatchKeyEventParams {.Key =return &}// WithWindowsVirtualKeyCode windows virtual key code (default: 0).func ( DispatchKeyEventParams) ( int64) *DispatchKeyEventParams {.WindowsVirtualKeyCode =return &}// WithNativeVirtualKeyCode native virtual key code (default: 0).func ( DispatchKeyEventParams) ( int64) *DispatchKeyEventParams {.NativeVirtualKeyCode =return &}// WithAutoRepeat whether the event was generated from auto repeat (default:// false).func ( DispatchKeyEventParams) ( bool) *DispatchKeyEventParams {.AutoRepeat =return &}// WithIsKeypad whether the event was generated from the keypad (default:// false).func ( DispatchKeyEventParams) ( bool) *DispatchKeyEventParams {.IsKeypad =return &}// WithIsSystemKey whether the event was a system key event (default: false).func ( DispatchKeyEventParams) ( bool) *DispatchKeyEventParams {.IsSystemKey =return &}// WithLocation whether the event was from the left or right side of the// keyboard. 1=Left, 2=Right (default: 0).func ( DispatchKeyEventParams) ( int64) *DispatchKeyEventParams {.Location =return &}// WithCommands 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/+/main:third_party/blink/renderer/core/editing/commands/editor_command_names.h// for valid command names.func ( DispatchKeyEventParams) ( []string) *DispatchKeyEventParams {.Commands =return &}// Do executes Input.dispatchKeyEvent against the provided context.func ( *DispatchKeyEventParams) ( context.Context) ( error) {return cdp.Execute(, CommandDispatchKeyEvent, , nil)}// InsertTextParams this method emulates inserting text that doesn't come// from a key press, for example an emoji keyboard or an IME.type InsertTextParams struct {Text string `json:"text"` // The text to insert.}// InsertText this method emulates inserting text that doesn't come from a// key press, for example an emoji keyboard or an IME.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Input#method-insertText//// parameters://// text - The text to insert.func ( string) *InsertTextParams {return &InsertTextParams{Text: ,}}// Do executes Input.insertText against the provided context.func ( *InsertTextParams) ( context.Context) ( error) {return cdp.Execute(, CommandInsertText, , nil)}// ImeSetCompositionParams this method sets the current candidate text for// ime. Use imeCommitComposition to commit the final text. Use imeSetComposition// with empty string as text to cancel composition.type ImeSetCompositionParams struct {Text string `json:"text"` // The text to insertSelectionStart int64 `json:"selectionStart"` // selection startSelectionEnd int64 `json:"selectionEnd"` // selection endReplacementStart int64 `json:"replacementStart,omitempty"` // replacement startReplacementEnd int64 `json:"replacementEnd,omitempty"` // replacement end}// ImeSetComposition this method sets the current candidate text for ime. Use// imeCommitComposition to commit the final text. Use imeSetComposition with// empty string as text to cancel composition.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Input#method-imeSetComposition//// parameters://// text - The text to insert// selectionStart - selection start// selectionEnd - selection endfunc ( string, int64, int64) *ImeSetCompositionParams {return &ImeSetCompositionParams{Text: ,SelectionStart: ,SelectionEnd: ,}}// WithReplacementStart replacement start.func ( ImeSetCompositionParams) ( int64) *ImeSetCompositionParams {.ReplacementStart =return &}// WithReplacementEnd replacement end.func ( ImeSetCompositionParams) ( int64) *ImeSetCompositionParams {.ReplacementEnd =return &}// Do executes Input.imeSetComposition against the provided context.func ( *ImeSetCompositionParams) ( context.Context) ( error) {return cdp.Execute(, CommandImeSetComposition, , nil)}// DispatchMouseEventParams dispatches a mouse event to the page.type DispatchMouseEventParams struct {Type MouseType `json:"type"` // Type of the mouse event.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 Modifier `json:"modifiers"` // 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 int64 `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 int64 `json:"clickCount,omitempty"` // Number of times the mouse button was clicked (default: 0).Force float64 `json:"force,omitempty"` // The normalized pressure, which has a range of [0,1] (default: 0).TangentialPressure float64 `json:"tangentialPressure,omitempty"` // The normalized tangential pressure, which has a range of [-1,1] (default: 0).TiltX float64 `json:"tiltX,omitempty"` // 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).TiltY float64 `json:"tiltY,omitempty"` // 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).Twist int64 `json:"twist,omitempty"` // The clockwise rotation of a pen stylus around its own major axis, in degrees in the range [0,359] (default: 0).DeltaX float64 `json:"deltaX"` // X delta in CSS pixels for mouse wheel event (default: 0).DeltaY float64 `json:"deltaY"` // Y delta in CSS pixels for mouse wheel event (default: 0).PointerType DispatchMouseEventPointerType `json:"pointerType,omitempty"` // Pointer type (default: "mouse").}// DispatchMouseEvent dispatches a mouse event to the page.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Input#method-dispatchMouseEvent//// parameters://// type - Type of the mouse event.// x - X coordinate of the event relative to the main frame's viewport in CSS pixels.// 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.func ( MouseType, float64, float64) *DispatchMouseEventParams {return &DispatchMouseEventParams{Type: ,X: ,Y: ,}}// WithModifiers bit field representing pressed modifier keys. Alt=1, Ctrl=2,// Meta/Command=4, Shift=8 (default: 0).func ( DispatchMouseEventParams) ( Modifier) *DispatchMouseEventParams {.Modifiers =return &}// WithTimestamp time at which the event occurred.func ( DispatchMouseEventParams) ( *TimeSinceEpoch) *DispatchMouseEventParams {.Timestamp =return &}// WithButton mouse button (default: "none").func ( DispatchMouseEventParams) ( MouseButton) *DispatchMouseEventParams {.Button =return &}// WithButtons 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 ( DispatchMouseEventParams) ( int64) *DispatchMouseEventParams {.Buttons =return &}// WithClickCount number of times the mouse button was clicked (default: 0).func ( DispatchMouseEventParams) ( int64) *DispatchMouseEventParams {.ClickCount =return &}// WithForce the normalized pressure, which has a range of [0,1] (default:// 0).func ( DispatchMouseEventParams) ( float64) *DispatchMouseEventParams {.Force =return &}// WithTangentialPressure the normalized tangential pressure, which has a// range of [-1,1] (default: 0).func ( DispatchMouseEventParams) ( float64) *DispatchMouseEventParams {.TangentialPressure =return &}// WithTiltX 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).func ( DispatchMouseEventParams) ( float64) *DispatchMouseEventParams {.TiltX =return &}// WithTiltY 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).func ( DispatchMouseEventParams) ( float64) *DispatchMouseEventParams {.TiltY =return &}// WithTwist the clockwise rotation of a pen stylus around its own major// axis, in degrees in the range [0,359] (default: 0).func ( DispatchMouseEventParams) ( int64) *DispatchMouseEventParams {.Twist =return &}// WithDeltaX X delta in CSS pixels for mouse wheel event (default: 0).func ( DispatchMouseEventParams) ( float64) *DispatchMouseEventParams {.DeltaX =return &}// WithDeltaY Y delta in CSS pixels for mouse wheel event (default: 0).func ( DispatchMouseEventParams) ( float64) *DispatchMouseEventParams {.DeltaY =return &}// WithPointerType pointer type (default: "mouse").func ( DispatchMouseEventParams) ( DispatchMouseEventPointerType) *DispatchMouseEventParams {.PointerType =return &}// Do executes Input.dispatchMouseEvent against the provided context.func ( *DispatchMouseEventParams) ( context.Context) ( error) {return cdp.Execute(, CommandDispatchMouseEvent, , nil)}// DispatchTouchEventParams dispatches a touch event to the page.type DispatchTouchEventParams struct {Type TouchType `json:"type"` // Type of the touch event. TouchEnd and TouchCancel must not contain any touch points, while TouchStart and TouchMove must contains at least one.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 Modifier `json:"modifiers"` // 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.}// DispatchTouchEvent dispatches a touch event to the page.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Input#method-dispatchTouchEvent//// parameters://// type - Type of the touch event. TouchEnd and TouchCancel must not contain any touch points, while TouchStart and TouchMove must contains at least one.// 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.func ( TouchType, []*TouchPoint) *DispatchTouchEventParams {return &DispatchTouchEventParams{Type: ,TouchPoints: ,}}// WithModifiers bit field representing pressed modifier keys. Alt=1, Ctrl=2,// Meta/Command=4, Shift=8 (default: 0).func ( DispatchTouchEventParams) ( Modifier) *DispatchTouchEventParams {.Modifiers =return &}// WithTimestamp time at which the event occurred.func ( DispatchTouchEventParams) ( *TimeSinceEpoch) *DispatchTouchEventParams {.Timestamp =return &}// Do executes Input.dispatchTouchEvent against the provided context.func ( *DispatchTouchEventParams) ( context.Context) ( error) {return cdp.Execute(, CommandDispatchTouchEvent, , nil)}// CancelDraggingParams cancels any active dragging in the page.type CancelDraggingParams struct{}// CancelDragging cancels any active dragging in the page.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Input#method-cancelDraggingfunc () *CancelDraggingParams {return &CancelDraggingParams{}}// Do executes Input.cancelDragging against the provided context.func ( *CancelDraggingParams) ( context.Context) ( error) {return cdp.Execute(, CommandCancelDragging, nil, nil)}// EmulateTouchFromMouseEventParams emulates touch event from the mouse event// parameters.type EmulateTouchFromMouseEventParams struct {Type MouseType `json:"type"` // Type of the mouse event.X int64 `json:"x"` // X coordinate of the mouse pointer in DIP.Y int64 `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"` // X delta in DIP for mouse wheel event (default: 0).DeltaY float64 `json:"deltaY"` // Y delta in DIP for mouse wheel event (default: 0).Modifiers Modifier `json:"modifiers"` // Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).ClickCount int64 `json:"clickCount,omitempty"` // Number of times the mouse button was clicked (default: 0).}// EmulateTouchFromMouseEvent emulates touch event from the mouse event// parameters.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Input#method-emulateTouchFromMouseEvent//// parameters://// type - Type of the mouse event.// x - X coordinate of the mouse pointer in DIP.// y - Y coordinate of the mouse pointer in DIP.// button - Mouse button. Only "none", "left", "right" are supported.func ( MouseType, int64, int64, MouseButton) *EmulateTouchFromMouseEventParams {return &EmulateTouchFromMouseEventParams{Type: ,X: ,Y: ,Button: ,}}// WithTimestamp time at which the event occurred (default: current time).func ( EmulateTouchFromMouseEventParams) ( *TimeSinceEpoch) *EmulateTouchFromMouseEventParams {.Timestamp =return &}// WithDeltaX X delta in DIP for mouse wheel event (default: 0).func ( EmulateTouchFromMouseEventParams) ( float64) *EmulateTouchFromMouseEventParams {.DeltaX =return &}// WithDeltaY Y delta in DIP for mouse wheel event (default: 0).func ( EmulateTouchFromMouseEventParams) ( float64) *EmulateTouchFromMouseEventParams {.DeltaY =return &}// WithModifiers bit field representing pressed modifier keys. Alt=1, Ctrl=2,// Meta/Command=4, Shift=8 (default: 0).func ( EmulateTouchFromMouseEventParams) ( Modifier) *EmulateTouchFromMouseEventParams {.Modifiers =return &}// WithClickCount number of times the mouse button was clicked (default: 0).func ( EmulateTouchFromMouseEventParams) ( int64) *EmulateTouchFromMouseEventParams {.ClickCount =return &}// Do executes Input.emulateTouchFromMouseEvent against the provided context.func ( *EmulateTouchFromMouseEventParams) ( context.Context) ( error) {return cdp.Execute(, CommandEmulateTouchFromMouseEvent, , nil)}// SetIgnoreInputEventsParams ignores input events (useful while auditing// page).type SetIgnoreInputEventsParams struct {Ignore bool `json:"ignore"` // Ignores input events processing when set to true.}// SetIgnoreInputEvents ignores input events (useful while auditing page).//// See: https://chromedevtools.github.io/devtools-protocol/tot/Input#method-setIgnoreInputEvents//// parameters://// ignore - Ignores input events processing when set to true.func ( bool) *SetIgnoreInputEventsParams {return &SetIgnoreInputEventsParams{Ignore: ,}}// Do executes Input.setIgnoreInputEvents against the provided context.func ( *SetIgnoreInputEventsParams) ( context.Context) ( error) {return cdp.Execute(, CommandSetIgnoreInputEvents, , nil)}// SetInterceptDragsParams prevents default drag and drop behavior and// instead emits Input.dragIntercepted events. Drag and drop behavior can be// directly controlled via Input.dispatchDragEvent.type SetInterceptDragsParams struct {Enabled bool `json:"enabled"`}// SetInterceptDrags prevents default drag and drop behavior and instead// emits Input.dragIntercepted events. Drag and drop behavior can be directly// controlled via Input.dispatchDragEvent.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Input#method-setInterceptDrags//// parameters://// enabledfunc ( bool) *SetInterceptDragsParams {return &SetInterceptDragsParams{Enabled: ,}}// Do executes Input.setInterceptDrags against the provided context.func ( *SetInterceptDragsParams) ( context.Context) ( error) {return cdp.Execute(, CommandSetInterceptDrags, , nil)}// SynthesizePinchGestureParams synthesizes a pinch gesture over a time// period by issuing appropriate touch events.type SynthesizePinchGestureParams 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 int64 `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).}// SynthesizePinchGesture synthesizes a pinch gesture over a time period by// issuing appropriate touch events.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Input#method-synthesizePinchGesture//// parameters://// x - X coordinate of the start of the gesture in CSS pixels.// y - Y coordinate of the start of the gesture in CSS pixels.// scaleFactor - Relative scale factor after zooming (>1.0 zooms in, <1.0 zooms out).func ( float64, float64, float64) *SynthesizePinchGestureParams {return &SynthesizePinchGestureParams{X: ,Y: ,ScaleFactor: ,}}// WithRelativeSpeed relative pointer speed in pixels per second (default:// 800).func ( SynthesizePinchGestureParams) ( int64) *SynthesizePinchGestureParams {.RelativeSpeed =return &}// WithGestureSourceType which type of input events to be generated (default:// 'default', which queries the platform for the preferred input type).func ( SynthesizePinchGestureParams) ( GestureSourceType) *SynthesizePinchGestureParams {.GestureSourceType =return &}// Do executes Input.synthesizePinchGesture against the provided context.func ( *SynthesizePinchGestureParams) ( context.Context) ( error) {return cdp.Execute(, CommandSynthesizePinchGesture, , nil)}// SynthesizeScrollGestureParams synthesizes a scroll gesture over a time// period by issuing appropriate touch events.type SynthesizeScrollGestureParams 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 int64 `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 int64 `json:"repeatCount,omitempty"` // The number of times to repeat the gesture (default: 0).RepeatDelayMs int64 `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: "").}// SynthesizeScrollGesture synthesizes a scroll gesture over a time period by// issuing appropriate touch events.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Input#method-synthesizeScrollGesture//// parameters://// x - X coordinate of the start of the gesture in CSS pixels.// y - Y coordinate of the start of the gesture in CSS pixels.func ( float64, float64) *SynthesizeScrollGestureParams {return &SynthesizeScrollGestureParams{X: ,Y: ,}}// WithXDistance the distance to scroll along the X axis (positive to scroll// left).func ( SynthesizeScrollGestureParams) ( float64) *SynthesizeScrollGestureParams {.XDistance =return &}// WithYDistance the distance to scroll along the Y axis (positive to scroll// up).func ( SynthesizeScrollGestureParams) ( float64) *SynthesizeScrollGestureParams {.YDistance =return &}// WithXOverscroll the number of additional pixels to scroll back along the X// axis, in addition to the given distance.func ( SynthesizeScrollGestureParams) ( float64) *SynthesizeScrollGestureParams {.XOverscroll =return &}// WithYOverscroll the number of additional pixels to scroll back along the Y// axis, in addition to the given distance.func ( SynthesizeScrollGestureParams) ( float64) *SynthesizeScrollGestureParams {.YOverscroll =return &}// WithPreventFling prevent fling (default: true).func ( SynthesizeScrollGestureParams) ( bool) *SynthesizeScrollGestureParams {.PreventFling =return &}// WithSpeed swipe speed in pixels per second (default: 800).func ( SynthesizeScrollGestureParams) ( int64) *SynthesizeScrollGestureParams {.Speed =return &}// WithGestureSourceType which type of input events to be generated (default:// 'default', which queries the platform for the preferred input type).func ( SynthesizeScrollGestureParams) ( GestureSourceType) *SynthesizeScrollGestureParams {.GestureSourceType =return &}// WithRepeatCount the number of times to repeat the gesture (default: 0).func ( SynthesizeScrollGestureParams) ( int64) *SynthesizeScrollGestureParams {.RepeatCount =return &}// WithRepeatDelayMs the number of milliseconds delay between each repeat.// (default: 250).func ( SynthesizeScrollGestureParams) ( int64) *SynthesizeScrollGestureParams {.RepeatDelayMs =return &}// WithInteractionMarkerName the name of the interaction markers to generate,// if not empty (default: "").func ( SynthesizeScrollGestureParams) ( string) *SynthesizeScrollGestureParams {.InteractionMarkerName =return &}// Do executes Input.synthesizeScrollGesture against the provided context.func ( *SynthesizeScrollGestureParams) ( context.Context) ( error) {return cdp.Execute(, CommandSynthesizeScrollGesture, , nil)}// SynthesizeTapGestureParams synthesizes a tap gesture over a time period by// issuing appropriate touch events.type SynthesizeTapGestureParams 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 int64 `json:"duration,omitempty"` // Duration between touchdown and touchup events in ms (default: 50).TapCount int64 `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).}// SynthesizeTapGesture synthesizes a tap gesture over a time period by// issuing appropriate touch events.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Input#method-synthesizeTapGesture//// parameters://// x - X coordinate of the start of the gesture in CSS pixels.// y - Y coordinate of the start of the gesture in CSS pixels.func ( float64, float64) *SynthesizeTapGestureParams {return &SynthesizeTapGestureParams{X: ,Y: ,}}// WithDuration duration between touchdown and touchup events in ms (default:// 50).func ( SynthesizeTapGestureParams) ( int64) *SynthesizeTapGestureParams {.Duration =return &}// WithTapCount number of times to perform the tap (e.g. 2 for double tap,// default: 1).func ( SynthesizeTapGestureParams) ( int64) *SynthesizeTapGestureParams {.TapCount =return &}// WithGestureSourceType which type of input events to be generated (default:// 'default', which queries the platform for the preferred input type).func ( SynthesizeTapGestureParams) ( GestureSourceType) *SynthesizeTapGestureParams {.GestureSourceType =return &}// Do executes Input.synthesizeTapGesture against the provided context.func ( *SynthesizeTapGestureParams) ( context.Context) ( error) {return cdp.Execute(, CommandSynthesizeTapGesture, , nil)}// Command names.const (CommandDispatchDragEvent = "Input.dispatchDragEvent"CommandDispatchKeyEvent = "Input.dispatchKeyEvent"CommandInsertText = "Input.insertText"CommandImeSetComposition = "Input.imeSetComposition"CommandDispatchMouseEvent = "Input.dispatchMouseEvent"CommandDispatchTouchEvent = "Input.dispatchTouchEvent"CommandCancelDragging = "Input.cancelDragging"CommandEmulateTouchFromMouseEvent = "Input.emulateTouchFromMouseEvent"CommandSetIgnoreInputEvents = "Input.setIgnoreInputEvents"CommandSetInterceptDrags = "Input.setInterceptDrags"CommandSynthesizePinchGesture = "Input.synthesizePinchGesture"CommandSynthesizeScrollGesture = "Input.synthesizeScrollGesture"CommandSynthesizeTapGesture = "Input.synthesizeTapGesture")
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |