public interface Input
Modifier and Type | Method and Description |
---|---|
void |
dispatchKeyEvent(KeyEventType type)
Dispatches a key event to the page.
|
void |
dispatchKeyEvent(KeyEventType type,
Integer modifiers,
Double timestamp,
String text,
String unmodifiedText,
String keyIdentifier,
String code,
String key,
Integer windowsVirtualKeyCode,
Integer nativeVirtualKeyCode,
Boolean autoRepeat,
Boolean isKeypad,
Boolean isSystemKey)
Dispatches a key event to the page.
|
void |
dispatchMouseEvent(MouseEventType type,
Integer x,
Integer y)
Dispatches a mouse event to the page.
|
void |
dispatchMouseEvent(MouseEventType type,
Integer x,
Integer y,
Integer modifiers,
Double timestamp,
MouseButtonType button,
Integer clickCount)
Dispatches a mouse event to the page.
|
void |
dispatchTouchEvent(TouchEventType type,
List<TouchPoint> touchPoints)
Dispatches a touch event to the page.
|
void |
dispatchTouchEvent(TouchEventType type,
List<TouchPoint> touchPoints,
Integer modifiers,
Double timestamp)
Dispatches a touch event to the page.
|
void |
emulateTouchFromMouseEvent(MouseEventType type,
Integer x,
Integer y,
Double timestamp,
MouseButtonType button)
Emulates touch event from the mouse event parameters.
|
void |
emulateTouchFromMouseEvent(MouseEventType type,
Integer x,
Integer y,
Double timestamp,
MouseButtonType button,
Double deltaX,
Double deltaY,
Integer modifiers,
Integer clickCount)
Emulates touch event from the mouse event parameters.
|
void |
setIgnoreInputEvents(Boolean ignore)
Ignores input events (useful while auditing page).
|
void |
synthesizePinchGesture(Integer x,
Integer y,
Double scaleFactor)
Synthesizes a pinch gesture over a time period by issuing appropriate touch events.
|
void |
synthesizePinchGesture(Integer x,
Integer y,
Double scaleFactor,
Integer relativeSpeed,
GestureSourceType gestureSourceType)
Synthesizes a pinch gesture over a time period by issuing appropriate touch events.
|
void |
synthesizeScrollGesture(Integer x,
Integer y)
Synthesizes a scroll gesture over a time period by issuing appropriate touch events.
|
void |
synthesizeScrollGesture(Integer x,
Integer y,
Integer xDistance,
Integer yDistance,
Integer xOverscroll,
Integer yOverscroll,
Boolean preventFling,
Integer speed,
GestureSourceType gestureSourceType,
Integer repeatCount,
Integer repeatDelayMs,
String interactionMarkerName)
Synthesizes a scroll gesture over a time period by issuing appropriate touch events.
|
void |
synthesizeTapGesture(Integer x,
Integer y)
Synthesizes a tap gesture over a time period by issuing appropriate touch events.
|
void |
synthesizeTapGesture(Integer x,
Integer y,
Integer duration,
Integer tapCount,
GestureSourceType gestureSourceType)
Synthesizes a tap gesture over a time period by issuing appropriate touch events.
|
void setIgnoreInputEvents(Boolean ignore)
ignore
- Ignores input events processing when set to true.void dispatchKeyEvent(KeyEventType type, Integer modifiers, Double timestamp, String text, String unmodifiedText, String keyIdentifier, String code, String key, Integer windowsVirtualKeyCode, Integer nativeVirtualKeyCode, Boolean autoRepeat, Boolean isKeypad, Boolean isSystemKey)
type
- Type of the key event.modifiers
- Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).timestamp
- Time at which the event occurred. Measured in UTC time in seconds since January 1, 1970 (default: current time).text
- Text as generated by processing a virtual key code with a keyboard layout. Not needed for for keyUp
and rawKeyDown
events (default: "")unmodifiedText
- 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
- Unique key identifier (e.g., 'U+0041') (default: "").code
- Unique DOM defined string value for each physical key (e.g., 'KeyA') (default: "").key
- 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
- Windows virtual key code (default: 0).nativeVirtualKeyCode
- Native virtual key code (default: 0).autoRepeat
- Whether the event was generated from auto repeat (default: false).isKeypad
- Whether the event was generated from the keypad (default: false).isSystemKey
- Whether the event was a system key event (default: false).void dispatchMouseEvent(MouseEventType type, Integer x, Integer y, Integer modifiers, Double timestamp, MouseButtonType button, Integer clickCount)
type
- Type of the mouse event.x
- X coordinate of the event relative to the main frame's viewport.y
- Y coordinate of the event relative to the main frame's viewport. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport.modifiers
- Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).timestamp
- Time at which the event occurred. Measured in UTC time in seconds since January 1, 1970 (default: current time).button
- Mouse button (default: "none").clickCount
- Number of times the mouse button was clicked (default: 0).void dispatchTouchEvent(TouchEventType type, List<TouchPoint> touchPoints, Integer modifiers, Double timestamp)
type
- Type of the touch event.touchPoints
- Touch points.modifiers
- Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).timestamp
- Time at which the event occurred. Measured in UTC time in seconds since January 1, 1970 (default: current time).void emulateTouchFromMouseEvent(MouseEventType type, Integer x, Integer y, Double timestamp, MouseButtonType button, Double deltaX, Double deltaY, Integer modifiers, Integer clickCount)
type
- Type of the mouse event.x
- X coordinate of the mouse pointer in DIP.y
- Y coordinate of the mouse pointer in DIP.timestamp
- Time at which the event occurred. Measured in UTC time in seconds since January 1, 1970.button
- Mouse button.deltaX
- X delta in DIP for mouse wheel event (default: 0).deltaY
- Y delta in DIP for mouse wheel event (default: 0).modifiers
- Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).clickCount
- Number of times the mouse button was clicked (default: 0).void synthesizePinchGesture(Integer x, Integer y, Double scaleFactor, Integer relativeSpeed, GestureSourceType gestureSourceType)
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).relativeSpeed
- Relative pointer speed in pixels per second (default: 800).gestureSourceType
- Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type).void synthesizeScrollGesture(Integer x, Integer y, Integer xDistance, Integer yDistance, Integer xOverscroll, Integer yOverscroll, Boolean preventFling, Integer speed, GestureSourceType gestureSourceType, Integer repeatCount, Integer repeatDelayMs, String interactionMarkerName)
x
- X coordinate of the start of the gesture in CSS pixels.y
- Y coordinate of the start of the gesture in CSS pixels.xDistance
- The distance to scroll along the X axis (positive to scroll left).yDistance
- The distance to scroll along the Y axis (positive to scroll up).xOverscroll
- The number of additional pixels to scroll back along the X axis, in addition to the given distance.yOverscroll
- The number of additional pixels to scroll back along the Y axis, in addition to the given distance.preventFling
- Prevent fling (default: true).speed
- Swipe speed in pixels per second (default: 800).gestureSourceType
- Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type).repeatCount
- The number of times to repeat the gesture (default: 0).repeatDelayMs
- The number of milliseconds delay between each repeat. (default: 250).interactionMarkerName
- The name of the interaction markers to generate, if not empty (default: "").void synthesizeTapGesture(Integer x, Integer y, Integer duration, Integer tapCount, GestureSourceType gestureSourceType)
x
- X coordinate of the start of the gesture in CSS pixels.y
- Y coordinate of the start of the gesture in CSS pixels.duration
- Duration between touchdown and touchup events in ms (default: 50).tapCount
- Number of times to perform the tap (e.g. 2 for double tap, default: 1).gestureSourceType
- Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type).void dispatchKeyEvent(KeyEventType type)
type
- Type of the key event.void dispatchMouseEvent(MouseEventType type, Integer x, Integer y)
type
- Type of the mouse event.x
- X coordinate of the event relative to the main frame's viewport.y
- Y coordinate of the event relative to the main frame's viewport. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport.void dispatchTouchEvent(TouchEventType type, List<TouchPoint> touchPoints)
type
- Type of the touch event.touchPoints
- Touch points.void emulateTouchFromMouseEvent(MouseEventType type, Integer x, Integer y, Double timestamp, MouseButtonType button)
type
- Type of the mouse event.x
- X coordinate of the mouse pointer in DIP.y
- Y coordinate of the mouse pointer in DIP.timestamp
- Time at which the event occurred. Measured in UTC time in seconds since January 1, 1970.button
- Mouse button.void synthesizePinchGesture(Integer x, Integer y, Double scaleFactor)
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).void synthesizeScrollGesture(Integer x, Integer y)
x
- X coordinate of the start of the gesture in CSS pixels.y
- Y coordinate of the start of the gesture in CSS pixels.Copyright © 2017 WebFolder OÜ. All rights reserved.