From d8702129fd0dd21d652b3cda6274963d476e640a Mon Sep 17 00:00:00 2001 From: Thiago Auler dos Santos Date: Tue, 28 Nov 2017 01:24:59 -0200 Subject: [PATCH] reading all possible keys and correcting them to apple 1 --- src/interface.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/interface.c b/src/interface.c index b4737f9..5db127b 100644 --- a/src/interface.c +++ b/src/interface.c @@ -12,7 +12,7 @@ void io_init() nodelay(stdscr, TRUE); keypad(stdscr, TRUE); - curs_set(FALSE); + //curs_set(FALSE); keyboard_control = 0x00; } @@ -20,10 +20,12 @@ void io_init() void input() { int ch = getch(); + + if (ch == 0x7F) { ch = '_'; } if (ch == '\n') { ch = '\r'; } - if (ch == '\r' || ch == '.' || ch == ':' || ch == ' ' || - (ch >= '0' && ch <= '9') || - (ch >= 'A' && ch <= 'Z')) + if (ch >= 'a' && ch <= 'z') { ch = ch - 0x20; } + + if (ch == '\r' || (ch >= 0x20 && ch <= 0x7F)) { keyboard_buffer = ch | 0x80; keyboard_control = 0xFF;