#include #include #ifndef UNIX #include #endif #include "aplinks.h" #ifdef UNIX #include "getch.h" #endif #define CTRL_D 0x04 #define UNIX_UP 0x41 #define UNIX_DOWN 0x42 #define UP 0x0b #define DOWN 0x0a #define KSH_UP 0x5e #define KSH_DOWN 0x5f int key_event(void) { int key; key = getch(); switch(key){ case CTRL_D : return 0; case UNIX_UP: case UP: case KSH_UP: case 'k': case 'K': case '8': scrl_up(); break; case UNIX_DOWN: case DOWN: case KSH_DOWN: case 'j': case 'J': case '2': scrl_down(); break; default : break; } return key; }