Skip to content

Commit 66547ed

Browse files
author
whhone
committed
[WebDriverKeys]
Adding a class containing pressable keys that aren't text. These are stored in the Unicode PUA (Private Use Area) code points.
1 parent e66cb58 commit 66547ed

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed

lib/WebDriverKeys.php

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?php
2+
// Copyright 2004-present Facebook. All Rights Reserved.
3+
//
4+
// Licensed under the Apache License; Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// httpconst //www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing; software
11+
// distributed under the License is distributed on an "AS IS" BASIS;
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND; either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
16+
/**
17+
* Representations of pressable keys that aren't text.
18+
* These are stored in the Unicode PUA (Private Use Area) code points.
19+
*/
20+
class WebDriverKeys {
21+
22+
const NULL = "\xEE\x80\x80";
23+
const CANCEL = "\xEE\x80\x81";
24+
const HELP = "\xEE\x80\x82";
25+
const BACKSPACE = "\xEE\x80\x83";
26+
const TAB = "\xEE\x80\x84";
27+
const CLEAR = "\xEE\x80\x85";
28+
const RETURN_KEY = "\xEE\x80\x86"; // php does not allow RETURN
29+
const ENTER = "\xEE\x80\x87";
30+
const SHIFT = "\xEE\x80\x88";
31+
const LEFT_SHIFT = "\xEE\x80\x88";
32+
const CONTROL = "\xEE\x80\x89";
33+
const LEFT_CONTROL = "\xEE\x80\x89";
34+
const ALT = "\xEE\x80\x8A";
35+
const LEFT_ALT = "\xEE\x80\x8A";
36+
const PAUSE = "\xEE\x80\x8B";
37+
const ESCAPE = "\xEE\x80\x8C";
38+
const SPACE = "\xEE\x80\x8D";
39+
const PAGE_UP = "\xEE\x80\x8E";
40+
const PAGE_DOWN = "\xEE\x80\x8F";
41+
const END = "\xEE\x80\x90";
42+
const HOME = "\xEE\x80\x91";
43+
const LEFT = "\xEE\x80\x92";
44+
const ARROW_LEFT = "\xEE\x80\x92";
45+
const UP = "\xEE\x80\x93";
46+
const ARROW_UP = "\xEE\x80\x93";
47+
const RIGHT = "\xEE\x80\x94";
48+
const ARROW_RIGHT = "\xEE\x80\x94";
49+
const DOWN = "\xEE\x80\x95";
50+
const ARROW_DOWN = "\xEE\x80\x95";
51+
const INSERT = "\xEE\x80\x96";
52+
const DELETE = "\xEE\x80\x97";
53+
const SEMICOLON = "\xEE\x80\x98";
54+
const EQUALS = "\xEE\x80\x99";
55+
const NUMPAD0 = "\xEE\x80\x9A";
56+
const NUMPAD1 = "\xEE\x80\x9B";
57+
const NUMPAD2 = "\xEE\x80\x9C";
58+
const NUMPAD3 = "\xEE\x80\x9D";
59+
const NUMPAD4 = "\xEE\x80\x9E";
60+
const NUMPAD5 = "\xEE\x80\x9F";
61+
const NUMPAD6 = "\xEE\x80\xA0";
62+
const NUMPAD7 = "\xEE\x80\xA1";
63+
const NUMPAD8 = "\xEE\x80\xA2";
64+
const NUMPAD9 = "\xEE\x80\xA3";
65+
const MULTIPLY = "\xEE\x80\xA4";
66+
const ADD = "\xEE\x80\xA5";
67+
const SEPARATOR = "\xEE\x80\xA6";
68+
const SUBTRACT = "\xEE\x80\xA7";
69+
const DECIMAL = "\xEE\x80\xA8";
70+
const DIVIDE = "\xEE\x80\xA9";
71+
const F1 = "\xEE\x80\xB1";
72+
const F2 = "\xEE\x80\xB2";
73+
const F3 = "\xEE\x80\xB3";
74+
const F4 = "\xEE\x80\xB4";
75+
const F5 = "\xEE\x80\xB5";
76+
const F6 = "\xEE\x80\xB6";
77+
const F7 = "\xEE\x80\xB7";
78+
const F8 = "\xEE\x80\xB8";
79+
const F9 = "\xEE\x80\xB9";
80+
const F10 = "\xEE\x80\xBA";
81+
const F11 = "\xEE\x80\xBB";
82+
const F12 = "\xEE\x80\xBC";
83+
const META = "\xEE\x80\xBD";
84+
const COMMAND = "\xEE\x80\xBD"; // ALIAS
85+
const ZENKAKU_HANKAKU = "\xEE\x80\xC0";
86+
}

lib/__init__.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
require_once('WebDriverElement.php');
2121
require_once('WebDriverExceptions.php');
2222
require_once('WebDriverExpectedCondition.php');
23+
require_once('WebDriverKeys.php');
2324
require_once('WebDriverNavigation.php');
2425
require_once('WebDriverOptions.php');
2526
require_once('WebDriverPoint.php');

0 commit comments

Comments
 (0)