Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 639ed82

Browse files
committed
Add new keyboard codes constants
1 parent 6a56eba commit 639ed82

File tree

1 file changed

+25
-9
lines changed

1 file changed

+25
-9
lines changed

lib/WebDriverKeys.php

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
/**
1919
* Representations of pressable keys that aren't text.
2020
* These are stored in the Unicode PUA (Private Use Area) code points.
21+
* @see https://w3c.github.io/webdriver/#keyboard-actions
2122
*/
2223
class WebDriverKeys
2324
{
@@ -27,28 +28,21 @@ class WebDriverKeys
2728
const BACKSPACE = "\xEE\x80\x83";
2829
const TAB = "\xEE\x80\x84";
2930
const CLEAR = "\xEE\x80\x85";
30-
const RETURN_KEY = "\xEE\x80\x86"; // php does not allow RETURN
31+
const RETURN_KEY = "\xEE\x80\x86";
3132
const ENTER = "\xEE\x80\x87";
3233
const SHIFT = "\xEE\x80\x88";
33-
const LEFT_SHIFT = "\xEE\x80\x88";
3434
const CONTROL = "\xEE\x80\x89";
35-
const LEFT_CONTROL = "\xEE\x80\x89";
3635
const ALT = "\xEE\x80\x8A";
37-
const LEFT_ALT = "\xEE\x80\x8A";
3836
const PAUSE = "\xEE\x80\x8B";
3937
const ESCAPE = "\xEE\x80\x8C";
4038
const SPACE = "\xEE\x80\x8D";
4139
const PAGE_UP = "\xEE\x80\x8E";
4240
const PAGE_DOWN = "\xEE\x80\x8F";
4341
const END = "\xEE\x80\x90";
4442
const HOME = "\xEE\x80\x91";
45-
const LEFT = "\xEE\x80\x92";
4643
const ARROW_LEFT = "\xEE\x80\x92";
47-
const UP = "\xEE\x80\x93";
4844
const ARROW_UP = "\xEE\x80\x93";
49-
const RIGHT = "\xEE\x80\x94";
5045
const ARROW_RIGHT = "\xEE\x80\x94";
51-
const DOWN = "\xEE\x80\x95";
5246
const ARROW_DOWN = "\xEE\x80\x95";
5347
const INSERT = "\xEE\x80\x96";
5448
const DELETE = "\xEE\x80\x97";
@@ -83,8 +77,30 @@ class WebDriverKeys
8377
const F11 = "\xEE\x80\xBB";
8478
const F12 = "\xEE\x80\xBC";
8579
const META = "\xEE\x80\xBD";
86-
const COMMAND = "\xEE\x80\xBD"; // ALIAS
8780
const ZENKAKU_HANKAKU = "\xEE\x80\xC0";
81+
const RIGHT_SHIFT = "\xEE\x81\x90";
82+
const RIGHT_CONTROL = "\xEE\x81\x91";
83+
const RIGHT_ALT = "\xEE\x81\x92";
84+
const RIGHT_META = "\xEE\x81\x93";
85+
const NUMPAD_PAGE_UP = "\xEE\x81\x94";
86+
const NUMPAD_PAGE_DOWN = "\xEE\x81\x95";
87+
const NUMPAD_END = "\xEE\x81\x96";
88+
const NUMPAD_HOME = "\xEE\x81\x97";
89+
const NUMPAD_ARROW_LEFT = "\xEE\x81\x98";
90+
const NUMPAD_ARROW_UP = "\xEE\x81\x99";
91+
const NUMPAD_ARROW_RIGHT = "\xEE\x81\x9A";
92+
const NUMPAD_ARROW_DOWN = "\xEE\x81\x9B";
93+
const NUMPAD_ARROW_INSERT = "\xEE\x81\x9C";
94+
const NUMPAD_ARROW_DELETE = "\xEE\x81\x9D";
95+
// Aliases
96+
const LEFT_SHIFT = self::SHIFT;
97+
const LEFT_CONTROL = self::CONTROL;
98+
const LEFT_ALT = self::ALT;
99+
const LEFT = self::ARROW_LEFT;
100+
const UP = self::ARROW_UP;
101+
const RIGHT = self::ARROW_RIGHT;
102+
const DOWN = self::ARROW_DOWN;
103+
const COMMAND = self::META;
88104

89105
/**
90106
* Encode input of `sendKeys()`.

0 commit comments

Comments
 (0)