version 1.2, 2009/07/21 17:57:29 |
version 1.3, 2009/07/26 21:42:08 |
|
|
#include <sys/time.h> |
#include <sys/time.h> |
|
|
#include <string.h> |
#include <string.h> |
|
#include <termios.h> |
|
#include <unistd.h> |
|
|
#include "tmux.h" |
#include "tmux.h" |
|
|
|
|
struct timeval tv; |
struct timeval tv; |
char *buf; |
char *buf; |
size_t len, size; |
size_t len, size; |
|
cc_t bspace; |
|
|
buf = BUFFER_OUT(tty->in); |
buf = BUFFER_OUT(tty->in); |
len = BUFFER_USED(tty->in); |
len = BUFFER_USED(tty->in); |
|
|
/* If a normal key, return it. */ |
/* If a normal key, return it. */ |
if (*buf != '\033') { |
if (*buf != '\033') { |
*key = buffer_read8(tty->in); |
*key = buffer_read8(tty->in); |
|
|
|
/* |
|
* Check for backspace key using termios VERASE - the terminfo |
|
* kbs entry is extremely unreliable, so cannot be safely |
|
* used. termios should have a better idea. |
|
*/ |
|
bspace = tty->tio.c_cc[VERASE]; |
|
if (bspace != _POSIX_VDISABLE && *key == bspace) |
|
*key = KEYC_BSPACE; |
goto found; |
goto found; |
} |
} |
|
|