appium-lg-webos-driver
Version:
LG WebOS support for Appium
43 lines (39 loc) • 837 B
JavaScript
const ENTER = 'enter';
const RIGHT = 'right';
const LEFT = 'left';
const UP = 'up';
const DOWN = 'down';
const BACK = 'back';
const PLAYPAUSE = 'playpause';
const FWD = 'fwd';
const REV = 'rev';
export const KEYS = Object.freeze(
/** @type {const} */ ({
ENTER,
RIGHT,
LEFT,
UP,
DOWN,
BACK,
PLAYPAUSE,
FWD,
REV,
}),
);
/**
* This is a mapping of some keys which are understood by a JS-based WebOS app
*/
export const KEYMAP = Object.freeze(/** @type {const} */({
[]: [0x0d, 'Enter'],
[]: [0x27, 'ArrowRight'],
[]: [0x25, 'ArrowLeft'],
[]: [0x26, 'ArrowUp'],
[]: [0x28, 'ArrowDown'],
[]: [0x1cd, 'Back'],
[]: [0x9f, '\x85'],
[]: [0xa9, 'Unidentified'],
[]: [0xa8, 'Unidentified'],
}));
/**
* @typedef {keyof typeof KEYMAP} KnownKey
*/