Skip to content

Commit 821f6a4

Browse files
committed
Revert "Fix various key support in fb mode"
This reverts commit b5cf8b0.
1 parent b5cf8b0 commit 821f6a4

1 file changed

Lines changed: 2 additions & 43 deletions

File tree

ESPHamClock/ArduinoLib/Adafruit_RA8875.cpp

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2871,51 +2871,10 @@ void Adafruit_RA8875::kbThread ()
28712871
if (nr == 1) {
28722872
// arrow keys need a state machine to parse ESC [ A/B/C/D, plus non-block for normal ESC
28732873
::printf ("KB: %d %c\n", buf[0], buf[0]);
2874-
char c = buf[0];
2875-
if (c == 27) {
2876-
// check if more characters are available (e.g. arrow keys ESC [ A/B/C/D)
2877-
int flags = fcntl(kb_fd, F_GETFL, 0);
2878-
fcntl(kb_fd, F_SETFL, flags | O_NONBLOCK);
2879-
char seq[2];
2880-
int n2 = read(kb_fd, &seq[0], 1);
2881-
if (n2 == 1) {
2882-
int n3 = read(kb_fd, &seq[1], 1);
2883-
if (n3 == 1) {
2884-
if (seq[0] == '[') {
2885-
if (seq[1] == 'A') c = CHAR_UP;
2886-
else if (seq[1] == 'B') c = CHAR_DOWN;
2887-
else if (seq[1] == 'C') c = CHAR_RIGHT;
2888-
else if (seq[1] == 'D') c = CHAR_LEFT;
2889-
else if (seq[1] == '3') {
2890-
char seq2[1];
2891-
if (read(kb_fd, &seq2[0], 1) == 1 && seq2[0] == '~') {
2892-
c = CHAR_DEL;
2893-
}
2894-
}
2895-
}
2896-
}
2897-
} else {
2898-
c = CHAR_ESC;
2899-
}
2900-
fcntl(kb_fd, F_SETFL, flags);
2901-
} else if (c == 127) {
2902-
c = CHAR_DEL;
2903-
} else if (c == '\r') {
2904-
c = CHAR_NL;
2905-
} else if (c == '\b') {
2906-
c = CHAR_BS;
2907-
} else if (c == '\t') {
2908-
c = CHAR_TAB;
2909-
} else if (c == '\n') {
2910-
c = CHAR_NL;
2911-
} else if (!isprint(c)) {
2912-
c = 0;
2913-
}
2914-
2915-
if (c) {
2874+
if (isprint(buf[0])) {
29162875
pthread_mutex_lock (&kb_lock);
29172876
KBState &ks = kb_q[kb_qtail];
2918-
ks.c = c;
2877+
ks.c = buf[0];
29192878
ks.control = false;
29202879
ks.shift = false;
29212880
if (++kb_qtail == KB_N)

0 commit comments

Comments
 (0)