Skip to content

Commit

Permalink
fix(keycode): f1-f4 + shift returns undefined key name (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
c4spar committed Nov 15, 2020
1 parent 2b9df6d commit 112c0b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion keycode/key_codes.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
/** Base key mapping. */
export const KeyMap: Record<string, string> = {
/* xterm/gnome ESC O letter */
/* xterm/gnome ESC [ letter (with modifier) */
"[P": "f1",
"[Q": "f2",
"[R": "f3",
"[S": "f4",

/* xterm/gnome ESC O letter (without modifier) */
"OP": "f1",
"OQ": "f2",
"OR": "f3",
Expand Down
2 changes: 1 addition & 1 deletion keycode/test/key_code_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from "../key_codes.ts";
import type { IKey, KeyEvent } from "../key_event.ts";

export const ESC = "\x1B";
const ESC = "\x1B";

const defaults = <IKey> {
sequence: undefined,
Expand Down

0 comments on commit 112c0b5

Please sign in to comment.