diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2016-03-30 13:20:29 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2016-03-30 13:20:29 +0200 |
commit | 25441348c4a28fd0821fe7a173e3c6cc166deb16 (patch) | |
tree | 6facf7c7a77fed51285d738ca6c85429c4bdf73b /fbi.c | |
parent | 8c315b4082bd2cc70d3df5a3d34f0aeaee17d386 (diff) | |
download | fbida-25441348c4a28fd0821fe7a173e3c6cc166deb16.tar.gz |
kbd support code
Diffstat (limited to 'fbi.c')
-rw-r--r-- | fbi.c | 47 |
1 files changed, 1 insertions, 46 deletions
@@ -38,6 +38,7 @@ #include "readers.h" #include "vt.h" +#include "kbd.h" #include "fbtools.h" #include "drmtools.h" #include "fb-gui.h" @@ -566,49 +567,6 @@ static void show_help(void) /* ---------------------------------------------------------------------- */ -struct termios saved_attributes; -int saved_fl; - -static void -tty_raw(void) -{ - struct termios tattr; - - fcntl(STDIN_FILENO, F_GETFL, &saved_fl); - tcgetattr (0, &saved_attributes); - - fcntl(STDIN_FILENO, F_SETFL, O_NONBLOCK); - memcpy(&tattr,&saved_attributes,sizeof(struct termios)); - tattr.c_lflag &= ~(ICANON|ECHO); - tattr.c_cc[VMIN] = 1; - tattr.c_cc[VTIME] = 0; - tcsetattr(STDIN_FILENO, TCSAFLUSH, &tattr); -} - -static void -tty_restore(void) -{ - fcntl(STDIN_FILENO, F_SETFL, saved_fl); - tcsetattr(STDIN_FILENO, TCSANOW, &saved_attributes); -} - -/* testing: find key codes */ -static void debug_key(char *key) -{ - char linebuffer[128]; - int i,len; - - len = sprintf(linebuffer,"key: "); - for (i = 0; key[i] != '\0'; i++) - len += snprintf(linebuffer+len, sizeof(linebuffer)-len, - "%s%c", - key[i] < 0x20 ? "^" : "", - key[i] < 0x20 ? key[i] + 0x40 : key[i]); - status_update(linebuffer, NULL); -} - -/* ---------------------------------------------------------------------- */ - static void free_image(struct ida_image *img) { if (img) { @@ -1193,9 +1151,6 @@ static char edit_line(struct ida_image *img, char *line, int max) len++; line[len] = 0; - } else if (0 /* debug */) { - debug_key(key); - sleep(1); } } while (1); } |