Skip to content

Commit

Permalink
ignore some keys, for now
Browse files Browse the repository at this point in the history
  • Loading branch information
kjloveless committed Nov 13, 2024
1 parent 0a6e15d commit 5b796bc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ interface EditorConfig {
}

enum EditorKey {
BACKSPACE = 127,
ARROW_LEFT = 1000,
ARROW_RIGHT,
ARROW_UP,
Expand Down Expand Up @@ -397,6 +398,9 @@ function editorProcessKeypress() {
const char = editorReadKey();

switch (char) {
case '\r'.charCodeAt(0):
// TODO
break;
case ctrlKey("q"):
exit("ciao, ciao");
break;
Expand All @@ -411,6 +415,12 @@ function editorProcessKeypress() {
}
break;

case EditorKey.BACKSPACE:
case EditorKey.DEL_KEY:
case ctrlKey('h'):
// TODO
break;

case EditorKey.PAGE_UP:
case EditorKey.PAGE_DOWN: {
if (char == EditorKey.PAGE_UP) {
Expand Down Expand Up @@ -438,6 +448,10 @@ function editorProcessKeypress() {
editorMoveCursor(char);
break;

case ctrlKey('l'):
case 0x1b:
break;

default:
editorInsertChar(String.fromCharCode(char));
break;
Expand Down

0 comments on commit 5b796bc

Please sign in to comment.