diff --git a/lib/libtuxtxt/tuxtxt.cpp b/lib/libtuxtxt/tuxtxt.cpp index 2086d976c..4fec1c501 100644 --- a/lib/libtuxtxt/tuxtxt.cpp +++ b/lib/libtuxtxt/tuxtxt.cpp @@ -6331,146 +6331,6 @@ int GetRCCode() return 0; } -#if 0 -#if 1 -int GetRCCode() -{ - struct input_event ev; - static __u16 rc_last_key = KEY_RESERVED; - - int val = fcntl(rc, F_GETFL); - if(!(val & O_NONBLOCK)) - printf("[tuxtxt] GetRCCode in blocking mode.\n"); - - /* get code */ - if (read(rc, &ev, sizeof(ev)) == sizeof(ev)) - { - if (ev.value) - { - if (ev.code != rc_last_key || - ev.code == KEY_DOWN || ev.code == KEY_UP || /* allow direction keys */ - ev.code == KEY_LEFT || ev.code == KEY_RIGHT) /* to autorepeat... */ - { - rc_last_key = ev.code; - switch (ev.code) - { - case KEY_UP: RCCode = RC_UP; break; - case KEY_DOWN: RCCode = RC_DOWN; break; - case KEY_LEFT: RCCode = RC_LEFT; break; - case KEY_RIGHT: RCCode = RC_RIGHT; break; - case KEY_OK: RCCode = RC_OK; break; - case KEY_0: RCCode = RC_0; break; - case KEY_1: RCCode = RC_1; break; - case KEY_2: RCCode = RC_2; break; - case KEY_3: RCCode = RC_3; break; - case KEY_4: RCCode = RC_4; break; - case KEY_5: RCCode = RC_5; break; - case KEY_6: RCCode = RC_6; break; - case KEY_7: RCCode = RC_7; break; - case KEY_8: RCCode = RC_8; break; - case KEY_9: RCCode = RC_9; break; - case KEY_RED: RCCode = RC_RED; break; - case KEY_GREEN: RCCode = RC_GREEN; break; - case KEY_YELLOW: RCCode = RC_YELLOW; break; - case KEY_BLUE: RCCode = RC_BLUE; break; - case KEY_VOLUMEUP: RCCode = RC_PLUS; break; - case KEY_VOLUMEDOWN: RCCode = RC_MINUS; break; - case KEY_MUTE: RCCode = RC_MUTE; break; -#if !HAVE_TRIPLEDRAGON - /* on CS, change transparent mode with TEXT key */ - case KEY_TEXT: RCCode = RC_TEXT; break; -#else - /* on TD, cycle split screen mode with TTX key - * - the TD has a special key for transparent mode */ - case KEY_TEXT: RCCode = RC_MINUS; break; -#endif - case KEY_TTTV: RCCode = RC_MUTE; break; - case KEY_TTZOOM: RCCode = RC_PLUS; break; - case KEY_REVEAL: RCCode = RC_HELP; break; - //case KEY_HELP: RCCode = RC_HELP; break; - case KEY_INFO: RCCode = RC_HELP; break; - case KEY_MENU: RCCode = RC_DBOX; break; - case KEY_EXIT: RCCode = RC_HOME; break; - case KEY_POWER: RCCode = RC_STANDBY; break; - } -printf("[tuxtxt] new key, code %X\n", RCCode); - return 1; - } - } - else - { - RCCode = -1; - rc_last_key = KEY_RESERVED; - } - } - - RCCode = -1; - usleep(1000000/25); - - return 0; -} -#else -/* this is obsolete and can soon be removed */ -int GetRCCode() -{ - static unsigned short LastKey = -1; - int count; - if ((count = read(rc, &RCCode, 2)) != 2) - { - RCCode = -1; - usleep(1000000/100); - return 0; - } - - fprintf(stderr, "rccode: %04x\n", RCCode); - if (RCCode == LastKey && - RCCode != 0x18 && RCCode != 0x19 && /* allow direction keys */ - RCCode != 0x1b && RCCode != 0x1c) /* to autorepeat... */ - { - RCCode = -1; - return 1; - } - - LastKey = RCCode; - if ((RCCode & 0xFF00) == 0x0000) - { - switch (RCCode) - { - case 0x18: RCCode = RC_UP; break; - case 0x1c: RCCode = RC_DOWN; break; - case 0x19: RCCode = RC_LEFT; break; - case 0x1b: RCCode = RC_RIGHT; break; - case 0x1a: RCCode = RC_OK; break; - case 0x0e: RCCode = RC_0; break; - case 0x02: RCCode = RC_1; break; - case 0x03: RCCode = RC_2; break; - case 0x04: RCCode = RC_3; break; - case 0x05: RCCode = RC_4; break; - case 0x06: RCCode = RC_5; break; - case 0x07: RCCode = RC_6; break; - case 0x09: RCCode = RC_7; break; - case 0x0a: RCCode = RC_8; break; - case 0x0b: RCCode = RC_9; break; - case 0x1f: RCCode = RC_RED; break; - case 0x20: RCCode = RC_GREEN; break; - case 0x21: RCCode = RC_YELLOW; break; - case 0x22: RCCode = RC_BLUE; break; - case 0x29: RCCode = RC_PLUS; break; // [=X=] key -> double height - case 0x27: RCCode = RC_MINUS; break; // [txt] key -> split mode - case 0x11: RCCode = RC_MUTE; break; - case 0x28: RCCode = RC_MUTE; break; // [ /=] key - case 0x14: RCCode = RC_HELP; break; - case 0x2a: RCCode = RC_HELP; break; // [==?] key - case 0x12: RCCode = RC_DBOX; break; - case 0x15: RCCode = RC_HOME; break; - case 0x01: RCCode = RC_STANDBY; break; - } - return 1; - } - return 1; -} -#endif -#endif /* Local Variables: */ /* indent-tabs-mode:t */ /* tab-width:3 */ diff --git a/lib/libtuxtxt/tuxtxt.h b/lib/libtuxtxt/tuxtxt.h index 9c49adf03..7ccc8994c 100644 --- a/lib/libtuxtxt/tuxtxt.h +++ b/lib/libtuxtxt/tuxtxt.h @@ -32,8 +32,6 @@ #include -#include - #include #include @@ -146,36 +144,6 @@ int tv_pip_y; #define hold_mosaic 0x1E #define release_mosaic 0x1F -#if 0 -/* rc codes */ -#define RC_0 0x00 -#define RC_1 0x01 -#define RC_2 0x02 -#define RC_3 0x03 -#define RC_4 0x04 -#define RC_5 0x05 -#define RC_6 0x06 -#define RC_7 0x07 -#define RC_8 0x08 -#define RC_9 0x09 -#define RC_RIGHT 0x0A -#define RC_LEFT 0x0B -#define RC_UP 0x0C -#define RC_DOWN 0x0D -#define RC_OK 0x0E -#define RC_MUTE 0x0F -#define RC_STANDBY 0x10 -#define RC_GREEN 0x11 -#define RC_YELLOW 0x12 -#define RC_RED 0x13 -#define RC_BLUE 0x14 -#define RC_PLUS 0x15 -#define RC_MINUS 0x16 -#define RC_HELP 0x17 -#define RC_DBOX 0x18 -#define RC_TEXT 0x19 -#define RC_HOME 0x1F -#else #define RC_0 CRCInput::RC_0 #define RC_1 CRCInput::RC_1 #define RC_2 CRCInput::RC_2 @@ -216,7 +184,6 @@ int tv_pip_y; #define RC_SPLIT (CRCInput::RC_MaxRC + 1) #define RC_TEXT CRCInput::RC_text #endif -#endif typedef enum /* object type */ {