+4
-2
@@ -46,7 +46,7 @@ void enableRawMode() {
|
||||
|
||||
#include <ctype.h> /* isprint */
|
||||
|
||||
char *key_to_string(int key) {
|
||||
char *keyToString(int key) {
|
||||
static char key_str[32];
|
||||
|
||||
if (key == '\r') {
|
||||
@@ -111,7 +111,7 @@ int editorReadKey() {
|
||||
/* read first byte — may be start of UTF-8 or escape */
|
||||
while (read(STDIN_FILENO, &c, 1) != 1)
|
||||
;
|
||||
appDebug("f : %X\r\n", c);
|
||||
appDebug("f : %hhu %ld\r\n", c, 0x200);
|
||||
|
||||
if (c == '\x1b') {
|
||||
char seq[6];
|
||||
@@ -120,6 +120,8 @@ int editorReadKey() {
|
||||
return '\x1b';
|
||||
if (read(STDIN_FILENO, &seq[1], 1) != 1)
|
||||
return '\x1b';
|
||||
appDebug("f2 : %s\r\n", seq);
|
||||
|
||||
if (seq[0] == '[') {
|
||||
if (seq[1] >= '0' && seq[1] <= '9') {
|
||||
if (read(STDIN_FILENO, &seq[2], 1) != 1)
|
||||
|
||||
Reference in New Issue
Block a user