| 1 | // Copyright 2012 Software Freedom Conservancy. All Rights Reserved. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | goog.provide('webdriver.Key'); |
| 16 | |
| 17 | |
| 18 | /** |
| 19 | * Representations of pressable keys that aren't text. These are stored in |
| 20 | * the Unicode PUA (Private Use Area) code points, 0xE000-0xF8FF. Refer to |
| 21 | * http://www.google.com.au/search?&q=unicode+pua&btnG=Search |
| 22 | * |
| 23 | * @enum {string} |
| 24 | */ |
| 25 | webdriver.Key = { |
| 26 | NULL: '\uE000', |
| 27 | CANCEL: '\uE001', // ^break |
| 28 | HELP: '\uE002', |
| 29 | BACK_SPACE: '\uE003', |
| 30 | TAB: '\uE004', |
| 31 | CLEAR: '\uE005', |
| 32 | RETURN: '\uE006', |
| 33 | ENTER: '\uE007', |
| 34 | SHIFT: '\uE008', |
| 35 | CONTROL: '\uE009', |
| 36 | ALT: '\uE00A', |
| 37 | PAUSE: '\uE00B', |
| 38 | ESCAPE: '\uE00C', |
| 39 | SPACE: '\uE00D', |
| 40 | PAGE_UP: '\uE00E', |
| 41 | PAGE_DOWN: '\uE00F', |
| 42 | END: '\uE010', |
| 43 | HOME: '\uE011', |
| 44 | ARROW_LEFT: '\uE012', |
| 45 | LEFT: '\uE012', |
| 46 | ARROW_UP: '\uE013', |
| 47 | UP: '\uE013', |
| 48 | ARROW_RIGHT: '\uE014', |
| 49 | RIGHT: '\uE014', |
| 50 | ARROW_DOWN: '\uE015', |
| 51 | DOWN: '\uE015', |
| 52 | INSERT: '\uE016', |
| 53 | DELETE: '\uE017', |
| 54 | SEMICOLON: '\uE018', |
| 55 | EQUALS: '\uE019', |
| 56 | |
| 57 | NUMPAD0: '\uE01A', // number pad keys |
| 58 | NUMPAD1: '\uE01B', |
| 59 | NUMPAD2: '\uE01C', |
| 60 | NUMPAD3: '\uE01D', |
| 61 | NUMPAD4: '\uE01E', |
| 62 | NUMPAD5: '\uE01F', |
| 63 | NUMPAD6: '\uE020', |
| 64 | NUMPAD7: '\uE021', |
| 65 | NUMPAD8: '\uE022', |
| 66 | NUMPAD9: '\uE023', |
| 67 | MULTIPLY: '\uE024', |
| 68 | ADD: '\uE025', |
| 69 | SEPARATOR: '\uE026', |
| 70 | SUBTRACT: '\uE027', |
| 71 | DECIMAL: '\uE028', |
| 72 | DIVIDE: '\uE029', |
| 73 | |
| 74 | F1: '\uE031', // function keys |
| 75 | F2: '\uE032', |
| 76 | F3: '\uE033', |
| 77 | F4: '\uE034', |
| 78 | F5: '\uE035', |
| 79 | F6: '\uE036', |
| 80 | F7: '\uE037', |
| 81 | F8: '\uE038', |
| 82 | F9: '\uE039', |
| 83 | F10: '\uE03A', |
| 84 | F11: '\uE03B', |
| 85 | F12: '\uE03C', |
| 86 | |
| 87 | COMMAND: '\uE03D', // Apple command key |
| 88 | META: '\uE03D' // alias for Windows key |
| 89 | }; |