class Selenium::DevTools::V85::Input
def dispatch_key_event(type:, modifiers: nil, timestamp: nil, text: nil, unmodified_text: nil, key_identifier: nil, code: nil, key: nil, windows_virtual_key_code: nil, native_virtual_key_code: nil, auto_repeat: nil, is_keypad: nil, is_system_key: nil, location: nil, commands: nil)
def dispatch_key_event(type:, modifiers: nil, timestamp: nil, text: nil, unmodified_text: nil, key_identifier: nil, code: nil, key: nil, windows_virtual_key_code: nil, native_virtual_key_code: nil, auto_repeat: nil, is_keypad: nil, is_system_key: nil, location: nil, commands: nil) @devtools.send_cmd('Input.dispatchKeyEvent', type: type, modifiers: modifiers, timestamp: timestamp, text: text, unmodifiedText: unmodified_text, keyIdentifier: key_identifier, code: code, key: key, windowsVirtualKeyCode: windows_virtual_key_code, nativeVirtualKeyCode: native_virtual_key_code, autoRepeat: auto_repeat, isKeypad: is_keypad, isSystemKey: is_system_key, location: location, commands: commands) end
def dispatch_mouse_event(type:, x:, y:, modifiers: nil, timestamp: nil, button: nil, buttons: nil, click_count: nil, delta_x: nil, delta_y: nil, pointer_type: nil)
def dispatch_mouse_event(type:, x:, y:, modifiers: nil, timestamp: nil, button: nil, buttons: nil, click_count: nil, delta_x: nil, delta_y: nil, pointer_type: nil) @devtools.send_cmd('Input.dispatchMouseEvent', type: type, x: x, y: y, modifiers: modifiers, timestamp: timestamp, button: button, buttons: buttons, clickCount: click_count, deltaX: delta_x, deltaY: delta_y, pointerType: pointer_type) end
def dispatch_touch_event(type:, touch_points:, modifiers: nil, timestamp: nil)
def dispatch_touch_event(type:, touch_points:, modifiers: nil, timestamp: nil) @devtools.send_cmd('Input.dispatchTouchEvent', type: type, touchPoints: touch_points, modifiers: modifiers, timestamp: timestamp) end
def emulate_touch_from_mouse_event(type:, x:, y:, button:, timestamp: nil, delta_x: nil, delta_y: nil, modifiers: nil, click_count: nil)
def emulate_touch_from_mouse_event(type:, x:, y:, button:, timestamp: nil, delta_x: nil, delta_y: nil, modifiers: nil, click_count: nil) @devtools.send_cmd('Input.emulateTouchFromMouseEvent', type: type, x: x, y: y, button: button, timestamp: timestamp, deltaX: delta_x, deltaY: delta_y, modifiers: modifiers, clickCount: click_count) end
def initialize(devtools)
def initialize(devtools) @devtools = devtools end
def insert_text(text:)
def insert_text(text:) @devtools.send_cmd('Input.insertText', text: text) end
def on(event, &block)
def on(event, &block) event = EVENTS[event] if event.is_a?(Symbol) @devtools.callbacks["Input.#{event}"] << block end
def set_ignore_input_events(ignore:)
def set_ignore_input_events(ignore:) @devtools.send_cmd('Input.setIgnoreInputEvents', ignore: ignore) end
def synthesize_pinch_gesture(x:, y:, scale_factor:, relative_speed: nil, gesture_source_type: nil)
def synthesize_pinch_gesture(x:, y:, scale_factor:, relative_speed: nil, gesture_source_type: nil) @devtools.send_cmd('Input.synthesizePinchGesture', x: x, y: y, scaleFactor: scale_factor, relativeSpeed: relative_speed, gestureSourceType: gesture_source_type) end
def synthesize_scroll_gesture(x:, y:, x_distance: nil, y_distance: nil, x_overscroll: nil, y_overscroll: nil, prevent_fling: nil, speed: nil, gesture_source_type: nil, repeat_count: nil, repeat_delay_ms: nil, interaction_marker_name: nil)
def synthesize_scroll_gesture(x:, y:, x_distance: nil, y_distance: nil, x_overscroll: nil, y_overscroll: nil, prevent_fling: nil, speed: nil, gesture_source_type: nil, repeat_count: nil, repeat_delay_ms: nil, interaction_marker_name: nil) @devtools.send_cmd('Input.synthesizeScrollGesture', x: x, y: y, xDistance: x_distance, yDistance: y_distance, xOverscroll: x_overscroll, yOverscroll: y_overscroll, preventFling: prevent_fling, speed: speed, gestureSourceType: gesture_source_type, repeatCount: repeat_count, repeatDelayMs: repeat_delay_ms, interactionMarkerName: interaction_marker_name) end
def synthesize_tap_gesture(x:, y:, duration: nil, tap_count: nil, gesture_source_type: nil)
def synthesize_tap_gesture(x:, y:, duration: nil, tap_count: nil, gesture_source_type: nil) @devtools.send_cmd('Input.synthesizeTapGesture', x: x, y: y, duration: duration, tapCount: tap_count, gestureSourceType: gesture_source_type) end