1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
U
[±dõLã@sŒddlmZddlmZmZddlmZddlZddlZeGdd„dƒƒZ    Gdd    „d    ej
ƒZ Gd
d „d ej
ƒZ Gd d „d e ƒZd7dddddddddddddddddœdd„Zdddœdd„Zd8dddddddddddddœ dd „Zd9dd!dddd"œd#d$„Zd:dd%d%d ddddddd&œ
d'd(„Zd)dd*œd+d,„Zd;ddddd-dd.œd/d0„Zd<ddddddddd-ddddd1œ d2d3„Zd=ddddd-dd4œd5d6„ZdS)>é)Ú annotationsé)Ú event_classÚ T_JSON_DICT)Ú    dataclassNc@sneZdZUded<ded<dZded<dZded<dZded<dZded    <dZded
<d d „Z    e
d d„ƒZ dS)Ú
TouchPointÚfloatÚxÚyNútyping.Optional[float]Úradius_xÚradius_yÚrotation_angleÚforceÚid_cCs‚tƒ}|j|d<|j|d<|jdk    r.|j|d<|jdk    rB|j|d<|jdk    rV|j|d<|jdk    rj|j|d<|jdk    r~|j|d<|S)Nr    r
ÚradiusXÚradiusYÚ rotationAnglerÚid)Údictr    r
r r rrr)ÚselfÚjson©rúdd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\selenium/webdriver/common/devtools/v85/input_.pyÚto_json%s
 
 
 
 
 
 
 
 
 
 
 
zTouchPoint.to_jsonc
CsŠ|t|dƒt|dƒd|kr*t|dƒndd|kr@t|dƒndd|krVt|dƒndd|krlt|dƒndd|kr‚t|dƒnddS)    Nr    r
rrrrr)r    r
r r rrr)r©ÚclsrrrrÚ    from_json5s
 
ùzTouchPoint.from_json) Ú__name__Ú
__module__Ú __qualname__Ú__annotations__r r rrrrÚ classmethodrrrrrr s
     rc@s,eZdZdZdZdZdd„Zedd„ƒZdS)    ÚGestureSourceTypeÚdefaultÚtouchZmousecCs|jS©N©Úvalue©rrrrrGszGestureSourceType.to_jsoncCs||ƒSr&rrrrrrJszGestureSourceType.from_jsonN)    rrr ÚDEFAULTZTOUCHZMOUSErr"rrrrrr#Bs r#c@s8eZdZdZdZdZdZdZdZdd„Z    e
d    d
„ƒZ d S) Ú MouseButtonÚnoneÚleftZmiddleÚrightÚbackZforwardcCs|jSr&r'r)rrrrWszMouseButton.to_jsoncCs||ƒSr&rrrrrrZszMouseButton.from_jsonN) rrr ÚNONEÚLEFTZMIDDLEÚRIGHTÚBACKÚFORWARDrr"rrrrrr+Osr+csBeZdZdZddœdd„Zedddœdd„ƒZ‡fd    d
„Z‡ZS) ÚTimeSinceEpochz<
    UTC time in seconds, counted from January 1, 1970.
    r)ÚreturncCs|Sr&rr)rrrrcszTimeSinceEpoch.to_json)rr6cCs||ƒSr&rrrrrrfszTimeSinceEpoch.from_jsoncsd tƒ ¡¡S)NzTimeSinceEpoch({}))ÚformatÚsuperÚ__repr__r)©Ú    __class__rrr9jszTimeSinceEpoch.__repr__)    rrr Ú__doc__rr"rr9Ú __classcell__rrr:rr5_s
r5Ústrztyping.Optional[int]ztyping.Optional[TimeSinceEpoch]ztyping.Optional[str]ztyping.Optional[bool]z!typing.Optional[typing.List[str]]z0typing.Generator[T_JSON_DICT, T_JSON_DICT, None])Útype_Ú    modifiersÚ    timestampÚtextÚunmodified_textÚkey_identifierÚcodeÚkeyÚwindows_virtual_key_codeÚnative_virtual_key_codeÚ auto_repeatÚ    is_keypadÚ is_system_keyÚlocationÚcommandsr6ccstƒ}||d<|dk    r||d<|dk    r2| ¡|d<|dk    rB||d<|dk    rR||d<|dk    rb||d<|dk    rr||d<|dk    r‚||d    <|dk    r’||d
<|    dk    r¢|    |d <|
dk    r²|
|d <| dk    rÂ| |d <| dk    rÒ| |d<| dk    râ| |d<|dk    rüdd„|Dƒ|d<d|dœ}|V}dS)a-
    Dispatches a key event to the page.
 
    :param type_: Type of the key event.
    :param modifiers: *(Optional)* Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
    :param timestamp: *(Optional)* Time at which the event occurred.
    :param text: *(Optional)* Text as generated by processing a virtual key code with a keyboard layout. Not needed for for ```keyUp```` and ````rawKeyDown```` events (default: "")
    :param unmodified_text: *(Optional)* Text that would have been generated by the keyboard if no modifiers were pressed (except for shift). Useful for shortcut (accelerator) key handling (default: "").
    :param key_identifier: *(Optional)* Unique key identifier (e.g., 'U+0041') (default: "").
    :param code: *(Optional)* Unique DOM defined string value for each physical key (e.g., 'KeyA') (default: "").
    :param key: *(Optional)* Unique DOM defined string value describing the meaning of the key in the context of active modifiers, keyboard layout, etc (e.g., 'AltGr') (default: "").
    :param windows_virtual_key_code: *(Optional)* Windows virtual key code (default: 0).
    :param native_virtual_key_code: *(Optional)* Native virtual key code (default: 0).
    :param auto_repeat: *(Optional)* Whether the event was generated from auto repeat (default: false).
    :param is_keypad: *(Optional)* Whether the event was generated from the keypad (default: false).
    :param is_system_key: *(Optional)* Whether the event was a system key event (default: false).
    :param location: *(Optional)* Whether the event was from the left or right side of the keyboard. 1=Left, 2=Right (default: 0).
    :param commands: **(EXPERIMENTAL)** *(Optional)* Editing commands to send with the key event (e.g., 'selectAll') (default: []). These are related to but not equal the command names used in ````document.execCommand``` and NSStandardKeyBindingResponding. See https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/editing/commands/editor_command_names.h for valid command names.
    ÚtypeNr@rArBZunmodifiedTextZ keyIdentifierrErFZwindowsVirtualKeyCodeZnativeVirtualKeyCodeZ
autoRepeatZisKeypadZ isSystemKeyrLcSsg|]}|‘qSrr©Ú.0ÚirrrÚ
<listcomp>¯sz&dispatch_key_event.<locals>.<listcomp>rMzInput.dispatchKeyEvent©ÚmethodÚparams©rr)r?r@rArBrCrDrErFrGrHrIrJrKrLrMrUÚcmd_dictrrrrÚdispatch_key_eventnsD$ þrX)rBr6ccs"tƒ}||d<d|dœ}|V}dS)zº
    This method emulates inserting text that doesn't come from a key press,
    for example an emoji keyboard or an IME.
 
    **EXPERIMENTAL**
 
    :param text: The text to insert.
    rBzInput.insertTextrSN©r)rBrUrWrrrrÚ insert_text·s þrZrztyping.Optional[MouseButton]r ) r?r    r
r@rAÚbuttonÚbuttonsÚ click_countÚdelta_xÚdelta_yÚ pointer_typer6c csºtƒ} || d<|| d<|| d<|dk    r.|| d<|dk    rB| ¡| d<|dk    rV| ¡| d<|dk    rf|| d<|dk    rv|| d    <|dk    r†|| d
<|    dk    r–|    | d <|
dk    r¦|
| d <d | dœ} | V} dS)a˜
    Dispatches a mouse event to the page.
 
    :param type_: Type of the mouse event.
    :param x: X coordinate of the event relative to the main frame's viewport in CSS pixels.
    :param 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.
    :param modifiers: *(Optional)* Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
    :param timestamp: *(Optional)* Time at which the event occurred.
    :param button: *(Optional)* Mouse button (default: "none").
    :param buttons: *(Optional)* 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.
    :param click_count: *(Optional)* Number of times the mouse button was clicked (default: 0).
    :param delta_x: *(Optional)* X delta in CSS pixels for mouse wheel event (default: 0).
    :param delta_y: *(Optional)* Y delta in CSS pixels for mouse wheel event (default: 0).
    :param pointer_type: *(Optional)* Pointer type (default: "mouse").
    rNr    r
Nr@rAr[r\Ú
clickCountÚdeltaXÚdeltaYZ pointerTypezInput.dispatchMouseEventrSrV)r?r    r
r@rAr[r\r]r^r_r`rUrWrrrrÚdispatch_mouse_eventËs0  þrdztyping.List[TouchPoint])r?Ú touch_pointsr@rAr6ccsXtƒ}||d<dd„|Dƒ|d<|dk    r0||d<|dk    rD| ¡|d<d|d    œ}|V}dS)
au
    Dispatches a touch event to the page.
 
    :param type_: Type of the touch event. TouchEnd and TouchCancel must not contain any touch points, while TouchStart and TouchMove must contains at least one.
    :param 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.
    :param modifiers: *(Optional)* Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
    :param timestamp: *(Optional)* Time at which the event occurred.
    rNcSsg|] }| ¡‘qSr)rrOrrrrRsz(dispatch_touch_event.<locals>.<listcomp>Z touchPointsNr@rAzInput.dispatchTouchEventrSrV)r?rer@rArUrWrrrrÚdispatch_touch_events þrfÚint)
r?r    r
r[rAr^r_r@r]r6c     cs’tƒ}    ||    d<||    d<||    d<| ¡|    d<|dk    r>| ¡|    d<|dk    rN||    d<|dk    r^||    d<|dk    rn||    d    <|dk    r~||    d
<d |    d œ}
|
V} dS) a)
    Emulates touch event from the mouse event parameters.
 
    **EXPERIMENTAL**
 
    :param type_: Type of the mouse event.
    :param x: X coordinate of the mouse pointer in DIP.
    :param y: Y coordinate of the mouse pointer in DIP.
    :param button: Mouse button. Only "none", "left", "right" are supported.
    :param timestamp: *(Optional)* Time at which the event occurred (default: current time).
    :param delta_x: *(Optional)* X delta in DIP for mouse wheel event (default: 0).
    :param delta_y: *(Optional)* Y delta in DIP for mouse wheel event (default: 0).
    :param modifiers: *(Optional)* Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
    :param click_count: *(Optional)* Number of times the mouse button was clicked (default: 0).
    rNr    r
r[NrArbrcr@raz Input.emulateTouchFromMouseEventrSrV) r?r    r
r[rAr^r_r@r]rUrWrrrrÚemulate_touch_from_mouse_events&  þrhÚbool)Úignorer6ccs"tƒ}||d<d|dœ}|V}dS)z‚
    Ignores input events (useful while auditing page).
 
    :param ignore: Ignores input events processing when set to true.
    rjzInput.setIgnoreInputEventsrSNrY)rjrUrWrrrrÚset_ignore_input_eventsNs þrkz"typing.Optional[GestureSourceType])r    r
Ú scale_factorÚrelative_speedÚgesture_source_typer6ccsVtƒ}||d<||d<||d<|dk    r.||d<|dk    rB| ¡|d<d|dœ}|V}dS)    ai
    Synthesizes a pinch gesture over a time period by issuing appropriate touch events.
 
    **EXPERIMENTAL**
 
    :param x: X coordinate of the start of the gesture in CSS pixels.
    :param y: Y coordinate of the start of the gesture in CSS pixels.
    :param scale_factor: Relative scale factor after zooming (>1.0 zooms in, <1.0 zooms out).
    :param relative_speed: *(Optional)* Relative pointer speed in pixels per second (default: 800).
    :param gesture_source_type: *(Optional)* Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type).
    r    r
Z scaleFactorNZ relativeSpeedÚgestureSourceTypezInput.synthesizePinchGesturerSrV)r    r
rlrmrnrUrWrrrrÚsynthesize_pinch_gesture_s þrp) r    r
Ú
x_distanceÚ
y_distanceÚ x_overscrollÚ y_overscrollÚ prevent_flingÚspeedrnÚ repeat_countÚrepeat_delay_msÚinteraction_marker_namer6c csÎtƒ} || d<|| d<|dk    r&|| d<|dk    r6|| d<|dk    rF|| d<|dk    rV|| d<|dk    rf|| d<|dk    rv|| d    <|dk    rŠ| ¡| d
<|    dk    rš|    | d <|
dk    rª|
| d <| dk    rº| | d <d| dœ} | V}dS)ai
    Synthesizes a scroll gesture over a time period by issuing appropriate touch events.
 
    **EXPERIMENTAL**
 
    :param x: X coordinate of the start of the gesture in CSS pixels.
    :param y: Y coordinate of the start of the gesture in CSS pixels.
    :param x_distance: *(Optional)* The distance to scroll along the X axis (positive to scroll left).
    :param y_distance: *(Optional)* The distance to scroll along the Y axis (positive to scroll up).
    :param x_overscroll: *(Optional)* The number of additional pixels to scroll back along the X axis, in addition to the given distance.
    :param y_overscroll: *(Optional)* The number of additional pixels to scroll back along the Y axis, in addition to the given distance.
    :param prevent_fling: *(Optional)* Prevent fling (default: true).
    :param speed: *(Optional)* Swipe speed in pixels per second (default: 800).
    :param gesture_source_type: *(Optional)* Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type).
    :param repeat_count: *(Optional)* The number of times to repeat the gesture (default: 0).
    :param repeat_delay_ms: *(Optional)* The number of milliseconds delay between each repeat. (default: 250).
    :param interaction_marker_name: *(Optional)* The name of the interaction markers to generate, if not empty (default: "").
    r    r
NZ    xDistanceZ    yDistanceZ xOverscrollZ yOverscrollZ preventFlingrvroÚ repeatCountZ repeatDelayMsZinteractionMarkerNamezInput.synthesizeScrollGesturerSrV)r    r
rqrrrsrtrurvrnrwrxryrUrWrrrrÚsynthesize_scroll_gesture€s6  þr{)r    r
ÚdurationÚ    tap_countrnr6ccs^tƒ}||d<||d<|dk    r&||d<|dk    r6||d<|dk    rJ| ¡|d<d|dœ}|V}dS)    au
    Synthesizes a tap gesture over a time period by issuing appropriate touch events.
 
    **EXPERIMENTAL**
 
    :param x: X coordinate of the start of the gesture in CSS pixels.
    :param y: Y coordinate of the start of the gesture in CSS pixels.
    :param duration: *(Optional)* Duration between touchdown and touchup events in ms (default: 50).
    :param tap_count: *(Optional)* Number of times to perform the tap (e.g. 2 for double tap, default: 1).
    :param gesture_source_type: *(Optional)* Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type).
    r    r
Nr|ZtapCountrozInput.synthesizeTapGesturerSrV)r    r
r|r}rnrUrWrrrrÚsynthesize_tap_gesture¾s þr~)NNNNNNNNNNNNNN)NNNNNNNN)NN)NNNNN)NN)
NNNNNNNNNN)NNN)Ú
__future__rÚutilrrZ dataclassesrÚenumÚtypingrÚEnumr#r+rr5rXrZrdrfrhrkrpr{r~rrrrÚ<module>s|  4 ñ.Iõ&:ü!÷"0û$ô(Aû