diff options
author | fishsoupisgood <github@madingley.org> | 2020-11-05 11:22:02 +0000 |
---|---|---|
committer | fishsoupisgood <github@madingley.org> | 2020-11-05 11:22:02 +0000 |
commit | 225c1b60f48c05057775e58f373beaf6dd65a3c7 (patch) | |
tree | 3118dbb8c04ecea72fbb89ec1abb2258d1a56f7a | |
parent | c3606b0b60e37f5af9e7b71a9e19c3f8097b4a61 (diff) | |
download | galaxy_sia-225c1b60f48c05057775e58f373beaf6dd65a3c7.tar.gz galaxy_sia-225c1b60f48c05057775e58f373beaf6dd65a3c7.tar.bz2 galaxy_sia-225c1b60f48c05057775e58f373beaf6dd65a3c7.zip |
fix ab and don't treet all random keys as ESC
-rw-r--r-- | keypad.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -421,12 +421,12 @@ static int gd_fn_key (int fd, char key, int dedup, GD_LCD *lcd) case 'a': case 'A': - key = 0xa; + key = 0xb; break; case 'b': case 'B': - key = 0xb; + key = 0xa; break; case '\n': @@ -434,8 +434,7 @@ static int gd_fn_key (int fd, char key, int dedup, GD_LCD *lcd) break; default: - key = 0xd; - break; + return -1; } if (dedup) key |= 0x80; @@ -655,9 +654,9 @@ int gd_keypad (int fd, const char *dfn, int debug) while ((ch = getch()) != 'q') { - if (ch == KEY_LEFT) ch = 'a'; + if (ch == KEY_LEFT) ch = 'b'; - if (ch == KEY_RIGHT) ch = 'b'; + if (ch == KEY_RIGHT) ch = 'a'; if (ch != ERR && !gd_fn_key_press (fd, ch, &l)) curses_show (&l); |