glendam/protocol/input

This module is generated from the Chrome DevTools Protocol schema.

Do not edit this file manually. Generator: dev/codegen/generate_bindings.gleam Regenerate with:

gleam run -m codegen/generate_bindings

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

    Represents the keyDown protocol value.

  • DispatchKeyEventTypeKeyUp

    Represents the keyUp protocol value.

  • DispatchKeyEventTypeRawKeyDown

    Represents the rawKeyDown protocol value.

  • DispatchKeyEventTypeChar

    Represents the char protocol value.

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

    Represents the mouse protocol value.

  • DispatchMouseEventPointerTypePen

    Represents the pen protocol value.

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

    Represents the mousePressed protocol value.

  • DispatchMouseEventTypeMouseReleased

    Represents the mouseReleased protocol value.

  • DispatchMouseEventTypeMouseMoved

    Represents the mouseMoved protocol value.

  • DispatchMouseEventTypeMouseWheel

    Represents the mouseWheel protocol value.

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

    Represents the touchStart protocol value.

  • DispatchTouchEventTypeTouchEnd

    Represents the touchEnd protocol value.

  • DispatchTouchEventTypeTouchMove

    Represents the touchMove protocol value.

  • DispatchTouchEventTypeTouchCancel

    Represents the touchCancel protocol value.

Represents the Chrome DevTools Protocol MouseButton value.

pub type MouseButton {
  MouseButtonNone
  MouseButtonLeft
  MouseButtonMiddle
  MouseButtonRight
  MouseButtonBack
  MouseButtonForward
}

Constructors

  • MouseButtonNone

    Represents the none protocol value.

  • MouseButtonLeft

    Represents the left protocol value.

  • MouseButtonMiddle

    Represents the middle protocol value.

  • MouseButtonRight

    Represents the right protocol value.

  • MouseButtonBack

    Represents the back protocol value.

  • MouseButtonForward

    Represents the forward protocol value.

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

pub type TimeSinceEpoch {
  TimeSinceEpoch(Float)
}

Constructors

  • TimeSinceEpoch(Float)

    Represents the TimeSinceEpoch protocol value.

Represents the Chrome DevTools Protocol TouchPoint value.

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),
    )

    Represents the TouchPoint protocol value.

    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.

Values

pub fn cancel_dragging(
  callback callback__: fn(String, option.Option(json.Json)) -> Result(
    dynamic.Dynamic,
    chrome.RequestError,
  ),
) -> Result(dynamic.Dynamic, chrome.RequestError)

Cancels any active dragging in the page.

pub fn dispatch_key_event(
  callback callback__: fn(String, option.Option(json.Json)) -> Result(
    dynamic.Dynamic,
    chrome.RequestError,
  ),
  type_ type_: DispatchKeyEventType,
  modifiers modifiers: option.Option(Int),
  timestamp timestamp: option.Option(TimeSinceEpoch),
  text text: option.Option(String),
  unmodified_text unmodified_text: option.Option(String),
  key_identifier key_identifier: option.Option(String),
  code code: option.Option(String),
  key key: option.Option(String),
  windows_virtual_key_code windows_virtual_key_code: option.Option(
    Int,
  ),
  native_virtual_key_code native_virtual_key_code: option.Option(
    Int,
  ),
  auto_repeat auto_repeat: option.Option(
    protocol_support.BooleanSetting,
  ),
  is_keypad is_keypad: option.Option(
    protocol_support.BooleanSetting,
  ),
  is_system_key is_system_key: option.Option(
    protocol_support.BooleanSetting,
  ),
  location location: option.Option(Int),
) -> Result(dynamic.Dynamic, chrome.RequestError)

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 for keyUp and rawKeyDown 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 callback__: fn(String, option.Option(json.Json)) -> Result(
    dynamic.Dynamic,
    chrome.RequestError,
  ),
  type_ type_: DispatchMouseEventType,
  x x: Float,
  y y: Float,
  modifiers modifiers: option.Option(Int),
  timestamp timestamp: option.Option(TimeSinceEpoch),
  button button: option.Option(MouseButton),
  buttons buttons: option.Option(Int),
  click_count click_count: option.Option(Int),
  tilt_x tilt_x: option.Option(Float),
  tilt_y tilt_y: option.Option(Float),
  delta_x delta_x: option.Option(Float),
  delta_y delta_y: option.Option(Float),
  pointer_type pointer_type: option.Option(
    DispatchMouseEventPointerType,
  ),
) -> Result(dynamic.Dynamic, chrome.RequestError)

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 callback__: fn(String, option.Option(json.Json)) -> Result(
    dynamic.Dynamic,
    chrome.RequestError,
  ),
  type_ type_: DispatchTouchEventType,
  touch_points touch_points: List(TouchPoint),
  modifiers modifiers: option.Option(Int),
  timestamp timestamp: option.Option(TimeSinceEpoch),
) -> Result(dynamic.Dynamic, chrome.RequestError)

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 callback__: fn(String, option.Option(json.Json)) -> Result(
    dynamic.Dynamic,
    chrome.RequestError,
  ),
  ignore ignore: protocol_support.BooleanSetting,
) -> Result(dynamic.Dynamic, chrome.RequestError)

Ignores input events (useful while auditing page).

Parameters:

  • ignore : Ignores input events processing when set to true.

Returns:

Search Document