| 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 | goog.provide('webdriver.Key'); |
| 19 | |
| 20 | |
| 21 | /** |
| 22 | * Representations of pressable keys that aren't text. These are stored in |
| 23 | * the Unicode PUA (Private Use Area) code points, 0xE000-0xF8FF. Refer to |
| 24 | * http://www.google.com.au/search?&q=unicode+pua&btnG=Search |
| 25 | * |
| 26 | * @enum {string} |
| 27 | */ |
| 28 | webdriver.Key = { |
| 29 | NULL: '\uE000', |
| 30 | CANCEL: '\uE001', // ^break |
| 31 | HELP: '\uE002', |
| 32 | BACK_SPACE: '\uE003', |
| 33 | TAB: '\uE004', |
| 34 | CLEAR: '\uE005', |
| 35 | RETURN: '\uE006', |
| 36 | ENTER: '\uE007', |
| 37 | SHIFT: '\uE008', |
| 38 | CONTROL: '\uE009', |
| 39 | ALT: '\uE00A', |
| 40 | PAUSE: '\uE00B', |
| 41 | ESCAPE: '\uE00C', |
| 42 | SPACE: '\uE00D', |
| 43 | PAGE_UP: '\uE00E', |
| 44 | PAGE_DOWN: '\uE00F', |
| 45 | END: '\uE010', |
| 46 | HOME: '\uE011', |
| 47 | ARROW_LEFT: '\uE012', |
| 48 | LEFT: '\uE012', |
| 49 | ARROW_UP: '\uE013', |
| 50 | UP: '\uE013', |
| 51 | ARROW_RIGHT: '\uE014', |
| 52 | RIGHT: '\uE014', |
| 53 | ARROW_DOWN: '\uE015', |
| 54 | DOWN: '\uE015', |
| 55 | INSERT: '\uE016', |
| 56 | DELETE: '\uE017', |
| 57 | SEMICOLON: '\uE018', |
| 58 | EQUALS: '\uE019', |
| 59 | |
| 60 | NUMPAD0: '\uE01A', // number pad keys |
| 61 | NUMPAD1: '\uE01B', |
| 62 | NUMPAD2: '\uE01C', |
| 63 | NUMPAD3: '\uE01D', |
| 64 | NUMPAD4: '\uE01E', |
| 65 | NUMPAD5: '\uE01F', |
| 66 | NUMPAD6: '\uE020', |
| 67 | NUMPAD7: '\uE021', |
| 68 | NUMPAD8: '\uE022', |
| 69 | NUMPAD9: '\uE023', |
| 70 | MULTIPLY: '\uE024', |
| 71 | ADD: '\uE025', |
| 72 | SEPARATOR: '\uE026', |
| 73 | SUBTRACT: '\uE027', |
| 74 | DECIMAL: '\uE028', |
| 75 | DIVIDE: '\uE029', |
| 76 | |
| 77 | F1: '\uE031', // function keys |
| 78 | F2: '\uE032', |
| 79 | F3: '\uE033', |
| 80 | F4: '\uE034', |
| 81 | F5: '\uE035', |
| 82 | F6: '\uE036', |
| 83 | F7: '\uE037', |
| 84 | F8: '\uE038', |
| 85 | F9: '\uE039', |
| 86 | F10: '\uE03A', |
| 87 | F11: '\uE03B', |
| 88 | F12: '\uE03C', |
| 89 | |
| 90 | COMMAND: '\uE03D', // Apple command key |
| 91 | META: '\uE03D' // alias for Windows key |
| 92 | }; |