main
Raw Download raw file
  1/*
  2 * noVNC: HTML5 VNC client
  3 * Copyright (C) 2018 The noVNC authors
  4 * Licensed under MPL 2.0 or any later version (see LICENSE.txt)
  5 */
  6
  7/*
  8 * Fallback mapping between HTML key codes (physical keys) and
  9 * HTML key values. This only works for keys that don't vary
 10 * between layouts. We also omit those who manage fine by mapping the
 11 * Unicode representation.
 12 *
 13 * See https://www.w3.org/TR/uievents-code/ for possible codes.
 14 * See https://www.w3.org/TR/uievents-key/ for possible values.
 15 */
 16
 17/* eslint-disable key-spacing */
 18
 19export default {
 20
 21// 3.1.1.1. Writing System Keys
 22
 23    'Backspace':        'Backspace',
 24
 25// 3.1.1.2. Functional Keys
 26
 27    'AltLeft':          'Alt',
 28    'AltRight':         'Alt', // This could also be 'AltGraph'
 29    'CapsLock':         'CapsLock',
 30    'ContextMenu':      'ContextMenu',
 31    'ControlLeft':      'Control',
 32    'ControlRight':     'Control',
 33    'Enter':            'Enter',
 34    'MetaLeft':         'Meta',
 35    'MetaRight':        'Meta',
 36    'ShiftLeft':        'Shift',
 37    'ShiftRight':       'Shift',
 38    'Tab':              'Tab',
 39    // FIXME: Japanese/Korean keys
 40
 41// 3.1.2. Control Pad Section
 42
 43    'Delete':           'Delete',
 44    'End':              'End',
 45    'Help':             'Help',
 46    'Home':             'Home',
 47    'Insert':           'Insert',
 48    'PageDown':         'PageDown',
 49    'PageUp':           'PageUp',
 50
 51// 3.1.3. Arrow Pad Section
 52
 53    'ArrowDown':        'ArrowDown',
 54    'ArrowLeft':        'ArrowLeft',
 55    'ArrowRight':       'ArrowRight',
 56    'ArrowUp':          'ArrowUp',
 57
 58// 3.1.4. Numpad Section
 59
 60    'NumLock':          'NumLock',
 61    'NumpadBackspace':  'Backspace',
 62    'NumpadClear':      'Clear',
 63
 64// 3.1.5. Function Section
 65
 66    'Escape':           'Escape',
 67    'F1':               'F1',
 68    'F2':               'F2',
 69    'F3':               'F3',
 70    'F4':               'F4',
 71    'F5':               'F5',
 72    'F6':               'F6',
 73    'F7':               'F7',
 74    'F8':               'F8',
 75    'F9':               'F9',
 76    'F10':              'F10',
 77    'F11':              'F11',
 78    'F12':              'F12',
 79    'F13':              'F13',
 80    'F14':              'F14',
 81    'F15':              'F15',
 82    'F16':              'F16',
 83    'F17':              'F17',
 84    'F18':              'F18',
 85    'F19':              'F19',
 86    'F20':              'F20',
 87    'F21':              'F21',
 88    'F22':              'F22',
 89    'F23':              'F23',
 90    'F24':              'F24',
 91    'F25':              'F25',
 92    'F26':              'F26',
 93    'F27':              'F27',
 94    'F28':              'F28',
 95    'F29':              'F29',
 96    'F30':              'F30',
 97    'F31':              'F31',
 98    'F32':              'F32',
 99    'F33':              'F33',
100    'F34':              'F34',
101    'F35':              'F35',
102    'PrintScreen':      'PrintScreen',
103    'ScrollLock':       'ScrollLock',
104    'Pause':            'Pause',
105
106// 3.1.6. Media Keys
107
108    'BrowserBack':      'BrowserBack',
109    'BrowserFavorites': 'BrowserFavorites',
110    'BrowserForward':   'BrowserForward',
111    'BrowserHome':      'BrowserHome',
112    'BrowserRefresh':   'BrowserRefresh',
113    'BrowserSearch':    'BrowserSearch',
114    'BrowserStop':      'BrowserStop',
115    'Eject':            'Eject',
116    'LaunchApp1':       'LaunchMyComputer',
117    'LaunchApp2':       'LaunchCalendar',
118    'LaunchMail':       'LaunchMail',
119    'MediaPlayPause':   'MediaPlay',
120    'MediaStop':        'MediaStop',
121    'MediaTrackNext':   'MediaTrackNext',
122    'MediaTrackPrevious': 'MediaTrackPrevious',
123    'Power':            'Power',
124    'Sleep':            'Sleep',
125    'AudioVolumeDown':  'AudioVolumeDown',
126    'AudioVolumeMute':  'AudioVolumeMute',
127    'AudioVolumeUp':    'AudioVolumeUp',
128    'WakeUp':           'WakeUp',
129};