Class: Selenium::DevTools::V85::Input

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium/devtools/v85/input.rb

Instance Method Summary collapse

Constructor Details

#initialize(devtools) ⇒ Input

Returns a new instance of Input.



26
27
28
# File 'lib/selenium/devtools/v85/input.rb', line 26

def initialize(devtools)
  @devtools = devtools
end

Instance Method Details

#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) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/selenium/devtools/v85/input.rb', line 35

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

#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) ⇒ Object



59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/selenium/devtools/v85/input.rb', line 59

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

#dispatch_touch_event(type:, touch_points:, modifiers: nil, timestamp: nil) ⇒ Object



74
75
76
77
78
79
80
# File 'lib/selenium/devtools/v85/input.rb', line 74

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

#emulate_touch_from_mouse_event(type:, x:, y:, button:, timestamp: nil, delta_x: nil, delta_y: nil, modifiers: nil, click_count: nil) ⇒ Object



82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/selenium/devtools/v85/input.rb', line 82

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

#insert_text(text:) ⇒ Object



54
55
56
57
# File 'lib/selenium/devtools/v85/input.rb', line 54

def insert_text(text:)
  @devtools.send_cmd('Input.insertText',
                     text: text)
end

#on(event, &block) ⇒ Object



30
31
32
33
# File 'lib/selenium/devtools/v85/input.rb', line 30

def on(event, &block)
  event = EVENTS[event] if event.is_a?(Symbol)
  @devtools.callbacks["Input.#{event}"] << block
end

#set_ignore_input_events(ignore:) ⇒ Object



95
96
97
98
# File 'lib/selenium/devtools/v85/input.rb', line 95

def set_ignore_input_events(ignore:)
  @devtools.send_cmd('Input.setIgnoreInputEvents',
                     ignore: ignore)
end

#synthesize_pinch_gesture(x:, y:, scale_factor:, relative_speed: nil, gesture_source_type: nil) ⇒ Object



100
101
102
103
104
105
106
107
# File 'lib/selenium/devtools/v85/input.rb', line 100

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

#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) ⇒ Object



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/selenium/devtools/v85/input.rb', line 109

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

#synthesize_tap_gesture(x:, y:, duration: nil, tap_count: nil, gesture_source_type: nil) ⇒ Object



125
126
127
128
129
130
131
132
# File 'lib/selenium/devtools/v85/input.rb', line 125

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