feat: add keypad key mappings
This commit is contained in:
@@ -14,6 +14,9 @@ test("encodeKeySequence maps common keys and modifiers", () => {
|
||||
|
||||
const shiftTab = encodeKeySequence({ keys: ["S-Tab"] });
|
||||
expect(shiftTab.data).toBe("\x1b[Z");
|
||||
|
||||
const kpEnter = encodeKeySequence({ keys: ["KPEnter"] });
|
||||
expect(kpEnter.data).toBe("\x1bOM");
|
||||
});
|
||||
|
||||
test("encodeKeySequence supports hex + literal with warnings", () => {
|
||||
|
||||
@@ -51,6 +51,22 @@ const namedKeyMap = new Map<string, string>([
|
||||
["f10", `${ESC}[21~`],
|
||||
["f11", `${ESC}[23~`],
|
||||
["f12", `${ESC}[24~`],
|
||||
["kp/", `${ESC}Oo`],
|
||||
["kp*", `${ESC}Oj`],
|
||||
["kp-", `${ESC}Om`],
|
||||
["kp+", `${ESC}Ok`],
|
||||
["kp7", `${ESC}Ow`],
|
||||
["kp8", `${ESC}Ox`],
|
||||
["kp9", `${ESC}Oy`],
|
||||
["kp4", `${ESC}Ot`],
|
||||
["kp5", `${ESC}Ou`],
|
||||
["kp6", `${ESC}Ov`],
|
||||
["kp1", `${ESC}Oq`],
|
||||
["kp2", `${ESC}Or`],
|
||||
["kp3", `${ESC}Os`],
|
||||
["kp0", `${ESC}Op`],
|
||||
["kp.", `${ESC}On`],
|
||||
["kpenter", `${ESC}OM`],
|
||||
]);
|
||||
|
||||
const modifiableNamedKeys = new Set([
|
||||
|
||||
Reference in New Issue
Block a user