123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.defaultKeyMap = void 0;
- var _types = require("./types");
- /**
- * Mapping for a default US-104-QWERTY keyboard
- */
- const defaultKeyMap = [// alphanumeric keys
- ...'0123456789'.split('').map(c => ({
- code: `Digit${c}`,
- key: c
- })), ...')!@#$%^&*('.split('').map((c, i) => ({
- code: `Digit${i}`,
- key: c,
- shiftKey: true
- })), ...'abcdefghijklmnopqrstuvwxyz'.split('').map(c => ({
- code: `Key${c.toUpperCase()}`,
- key: c
- })), ...'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('').map(c => ({
- code: `Key${c}`,
- key: c,
- shiftKey: true
- })), // alphanumeric block - functional
- {
- code: 'Space',
- key: ' '
- }, {
- code: 'AltLeft',
- key: 'Alt',
- location: _types.DOM_KEY_LOCATION.LEFT,
- keyCode: 18
- }, {
- code: 'AltRight',
- key: 'Alt',
- location: _types.DOM_KEY_LOCATION.RIGHT,
- keyCode: 18
- }, {
- code: 'ShiftLeft',
- key: 'Shift',
- location: _types.DOM_KEY_LOCATION.LEFT,
- keyCode: 16
- }, {
- code: 'ShiftRight',
- key: 'Shift',
- location: _types.DOM_KEY_LOCATION.RIGHT,
- keyCode: 16
- }, {
- code: 'ControlLeft',
- key: 'Control',
- location: _types.DOM_KEY_LOCATION.LEFT,
- keyCode: 17
- }, {
- code: 'ControlRight',
- key: 'Control',
- location: _types.DOM_KEY_LOCATION.RIGHT,
- keyCode: 17
- }, {
- code: 'MetaLeft',
- key: 'Meta',
- location: _types.DOM_KEY_LOCATION.LEFT,
- keyCode: 93
- }, {
- code: 'MetaRight',
- key: 'Meta',
- location: _types.DOM_KEY_LOCATION.RIGHT,
- keyCode: 93
- }, {
- code: 'OSLeft',
- key: 'OS',
- location: _types.DOM_KEY_LOCATION.LEFT,
- keyCode: 91
- }, {
- code: 'OSRight',
- key: 'OS',
- location: _types.DOM_KEY_LOCATION.RIGHT,
- keyCode: 91
- }, {
- code: 'CapsLock',
- key: 'CapsLock',
- keyCode: 20
- }, {
- code: 'Backspace',
- key: 'Backspace',
- keyCode: 8
- }, {
- code: 'Enter',
- key: 'Enter',
- keyCode: 13
- }, // function
- {
- code: 'Escape',
- key: 'Escape',
- keyCode: 27
- }, // arrows
- {
- code: 'ArrowUp',
- key: 'ArrowUp',
- keyCode: 38
- }, {
- code: 'ArrowDown',
- key: 'ArrowDown',
- keyCode: 40
- }, {
- code: 'ArrowLeft',
- key: 'ArrowLeft',
- keyCode: 37
- }, {
- code: 'ArrowRight',
- key: 'ArrowRight',
- keyCode: 39
- }, // control pad
- {
- code: 'Home',
- key: 'Home',
- keyCode: 36
- }, {
- code: 'End',
- key: 'End',
- keyCode: 35
- }, {
- code: 'Delete',
- key: 'Delete',
- keyCode: 46
- }, {
- code: 'PageUp',
- key: 'PageUp',
- keyCode: 33
- }, {
- code: 'PageDown',
- key: 'PageDown',
- keyCode: 34
- } // TODO: add mappings
- ];
- exports.defaultKeyMap = defaultKeyMap;
|