Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
SeleniumHQ
GitHub Repository: SeleniumHQ/Selenium
Path: blob/trunk/py/selenium/webdriver/common/keys.py
1864 views
1
# Licensed to the Software Freedom Conservancy (SFC) under one
2
# or more contributor license agreements. See the NOTICE file
3
# distributed with this work for additional information
4
# regarding copyright ownership. The SFC licenses this file
5
# to you under the Apache License, Version 2.0 (the
6
# "License"); you may not use this file except in compliance
7
# with the License. You may obtain a copy of the License at
8
#
9
# http://www.apache.org/licenses/LICENSE-2.0
10
#
11
# Unless required by applicable law or agreed to in writing,
12
# software distributed under the License is distributed on an
13
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
# KIND, either express or implied. See the License for the
15
# specific language governing permissions and limitations
16
# under the License.
17
18
"""The Keys implementation."""
19
20
21
class Keys:
22
"""Set of special key codes for input actions.
23
24
Primarily intended for keyboard usage, but also applied in other contexts
25
such as Action Chains and IME interactions.
26
"""
27
28
NULL = "\ue000"
29
CANCEL = "\ue001" # ^break
30
HELP = "\ue002"
31
BACKSPACE = "\ue003"
32
BACK_SPACE = BACKSPACE
33
TAB = "\ue004"
34
CLEAR = "\ue005"
35
RETURN = "\ue006"
36
ENTER = "\ue007"
37
SHIFT = "\ue008"
38
LEFT_SHIFT = SHIFT
39
RIGHT_SHIFT = "\ue050"
40
CONTROL = "\ue009"
41
LEFT_CONTROL = CONTROL
42
RIGHT_CONTROL = "\ue051"
43
ALT = "\ue00a"
44
LEFT_ALT = ALT
45
RIGHT_ALT = "\ue052"
46
PAUSE = "\ue00b"
47
ESCAPE = "\ue00c"
48
SPACE = "\ue00d"
49
PAGE_UP = "\ue00e"
50
PAGE_DOWN = "\ue00f"
51
END = "\ue010"
52
HOME = "\ue011"
53
LEFT = "\ue012"
54
ARROW_LEFT = LEFT
55
UP = "\ue013"
56
ARROW_UP = UP
57
RIGHT = "\ue014"
58
ARROW_RIGHT = RIGHT
59
DOWN = "\ue015"
60
ARROW_DOWN = DOWN
61
INSERT = "\ue016"
62
DELETE = "\ue017"
63
SEMICOLON = "\ue018"
64
EQUALS = "\ue019"
65
66
# Keys representing number pad digits
67
NUMPAD0 = "\ue01a"
68
NUMPAD1 = "\ue01b"
69
NUMPAD2 = "\ue01c"
70
NUMPAD3 = "\ue01d"
71
NUMPAD4 = "\ue01e"
72
NUMPAD5 = "\ue01f"
73
NUMPAD6 = "\ue020"
74
NUMPAD7 = "\ue021"
75
NUMPAD8 = "\ue022"
76
NUMPAD9 = "\ue023"
77
78
MULTIPLY = "\ue024"
79
ADD = "\ue025"
80
SEPARATOR = "\ue026"
81
SUBTRACT = "\ue027"
82
DECIMAL = "\ue028"
83
DIVIDE = "\ue029"
84
85
# Function keys
86
F1 = "\ue031"
87
F2 = "\ue032"
88
F3 = "\ue033"
89
F4 = "\ue034"
90
F5 = "\ue035"
91
F6 = "\ue036"
92
F7 = "\ue037"
93
F8 = "\ue038"
94
F9 = "\ue039"
95
F10 = "\ue03a"
96
F11 = "\ue03b"
97
F12 = "\ue03c"
98
99
META = "\ue03d"
100
LEFT_META = META
101
RIGHT_META = "\ue053"
102
COMMAND = "\ue03d"
103
LEFT_COMMAND = COMMAND
104
ZENKAKU_HANKAKU = "\ue040"
105
106
# Extended macOS keys
107
LEFT_OPTION = LEFT_ALT
108
RIGHT_OPTION = RIGHT_ALT
109
110