protocol/input
⚙️ This module was generated from the Chrome DevTools Protocol version 1.3
Input Domain
This protocol domain has no description.
📖 View this domain on the DevTools Protocol API Docs
Types
This type is not part of the protocol spec, it has been generated dynamically
to represent the possible values of the enum property type
of dispatchKeyEvent
pub type DispatchKeyEventType {
DispatchKeyEventTypeKeyDown
DispatchKeyEventTypeKeyUp
DispatchKeyEventTypeRawKeyDown
DispatchKeyEventTypeChar
}
Constructors
-
DispatchKeyEventTypeKeyDown
-
DispatchKeyEventTypeKeyUp
-
DispatchKeyEventTypeRawKeyDown
-
DispatchKeyEventTypeChar
This type is not part of the protocol spec, it has been generated dynamically
to represent the possible values of the enum property pointerType
of dispatchMouseEvent
pub type DispatchMouseEventPointerType {
DispatchMouseEventPointerTypeMouse
DispatchMouseEventPointerTypePen
}
Constructors
-
DispatchMouseEventPointerTypeMouse
-
DispatchMouseEventPointerTypePen
This type is not part of the protocol spec, it has been generated dynamically
to represent the possible values of the enum property type
of dispatchMouseEvent
pub type DispatchMouseEventType {
DispatchMouseEventTypeMousePressed
DispatchMouseEventTypeMouseReleased
DispatchMouseEventTypeMouseMoved
DispatchMouseEventTypeMouseWheel
}
Constructors
-
DispatchMouseEventTypeMousePressed
-
DispatchMouseEventTypeMouseReleased
-
DispatchMouseEventTypeMouseMoved
-
DispatchMouseEventTypeMouseWheel
This type is not part of the protocol spec, it has been generated dynamically
to represent the possible values of the enum property type
of dispatchTouchEvent
pub type DispatchTouchEventType {
DispatchTouchEventTypeTouchStart
DispatchTouchEventTypeTouchEnd
DispatchTouchEventTypeTouchMove
DispatchTouchEventTypeTouchCancel
}
Constructors
-
DispatchTouchEventTypeTouchStart
-
DispatchTouchEventTypeTouchEnd
-
DispatchTouchEventTypeTouchMove
-
DispatchTouchEventTypeTouchCancel
pub type MouseButton {
MouseButtonNone
MouseButtonLeft
MouseButtonMiddle
MouseButtonRight
MouseButtonBack
MouseButtonForward
}
Constructors
-
MouseButtonNone
-
MouseButtonLeft
-
MouseButtonMiddle
-
MouseButtonRight
-
MouseButtonBack
-
MouseButtonForward
UTC time in seconds, counted from January 1, 1970.
pub type TimeSinceEpoch {
TimeSinceEpoch(Float)
}
Constructors
-
TimeSinceEpoch(Float)
pub type TouchPoint {
TouchPoint(
x: Float,
y: Float,
radius_x: option.Option(Float),
radius_y: option.Option(Float),
rotation_angle: option.Option(Float),
force: option.Option(Float),
tilt_x: option.Option(Float),
tilt_y: option.Option(Float),
id: option.Option(Float),
)
}
Constructors
-
TouchPoint( x: Float, y: Float, radius_x: option.Option(Float), radius_y: option.Option(Float), rotation_angle: option.Option(Float), force: option.Option(Float), tilt_x: option.Option(Float), tilt_y: option.Option(Float), id: option.Option(Float), )
Arguments
-
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.
-
radius_x
X radius of the touch area (default: 1.0).
-
radius_y
Y radius of the touch area (default: 1.0).
-
rotation_angle
Rotation angle (default: 0.0).
-
force
Force (default: 1.0).
-
tilt_x
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)
-
tilt_y
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).
-
id
Identifier used to track touch sources between events, must be unique within an event.
-
Functions
pub fn cancel_dragging(
callback__: fn(String, Option(a)) -> b,
) -> b
Cancels any active dragging in the page.
pub fn dispatch_key_event(
callback__: fn(String, Option(Json)) -> a,
type_ type_: DispatchKeyEventType,
modifiers modifiers: Option(Int),
timestamp timestamp: Option(TimeSinceEpoch),
text text: Option(String),
unmodified_text unmodified_text: Option(String),
key_identifier key_identifier: Option(String),
code code: Option(String),
key key: Option(String),
windows_virtual_key_code windows_virtual_key_code: Option(Int),
native_virtual_key_code native_virtual_key_code: Option(Int),
auto_repeat auto_repeat: Option(Bool),
is_keypad is_keypad: Option(Bool),
is_system_key is_system_key: Option(Bool),
location location: Option(Int),
) -> a
Dispatches a key event to the page.
Parameters:
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.text
: Text as generated by processing a virtual key code with a keyboard layout. Not needed for forkeyUp
andrawKeyDown
events (default: “”)unmodified_text
: Text that would have been generated by the keyboard if no modifiers were pressed (except for shift). Useful for shortcut (accelerator) key handling (default: “”).key_identifier
: 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: “”).windows_virtual_key_code
: Windows virtual key code (default: 0).native_virtual_key_code
: Native virtual key code (default: 0).auto_repeat
: Whether the event was generated from auto repeat (default: false).is_keypad
: Whether the event was generated from the keypad (default: false).is_system_key
: Whether the event was a system key event (default: false).location
: Whether the event was from the left or right side of the keyboard. 1=Left, 2=Right (default: 0).
Returns:
pub fn dispatch_mouse_event(
callback__: fn(String, Option(Json)) -> a,
type_ type_: DispatchMouseEventType,
x x: Float,
y y: Float,
modifiers modifiers: Option(Int),
timestamp timestamp: Option(TimeSinceEpoch),
button button: Option(MouseButton),
buttons buttons: Option(Int),
click_count click_count: Option(Int),
tilt_x tilt_x: Option(Float),
tilt_y tilt_y: Option(Float),
delta_x delta_x: Option(Float),
delta_y delta_y: Option(Float),
pointer_type pointer_type: Option(DispatchMouseEventPointerType),
) -> a
Dispatches a mouse event to the page.
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.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.button
: Mouse button (default: “none”).buttons
: 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.click_count
: Number of times the mouse button was clicked (default: 0).tilt_x
: 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).tilt_y
: 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).delta_x
: X delta in CSS pixels for mouse wheel event (default: 0).delta_y
: Y delta in CSS pixels for mouse wheel event (default: 0).pointer_type
: Pointer type (default: “mouse”).
Returns:
pub fn dispatch_touch_event(
callback__: fn(String, Option(Json)) -> a,
type_ type_: DispatchTouchEventType,
touch_points touch_points: List(TouchPoint),
modifiers modifiers: Option(Int),
timestamp timestamp: Option(TimeSinceEpoch),
) -> a
Dispatches a touch event to the page.
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.touch_points
: 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
: Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).timestamp
: Time at which the event occurred.
Returns:
pub fn set_ignore_input_events(
callback__: fn(String, Option(Json)) -> a,
ignore ignore: Bool,
) -> a
Ignores input events (useful while auditing page).
Parameters:
ignore
: Ignores input events processing when set to true.
Returns: