Switch tty key input over to happen on a read event. This is a bit more

complicated because of escape input, but in that case instead of processing a
key immediately, schedule a timer and reprocess the bufer when it expires.

This currently assumes that keys will be atomic (ie that if eg F1 is pressed
the entire sequence is present in the buffer). This is usually but not always
true, a change in the tree format so it can differentiate potential (partial)
key sequences will happens soon and will allow this to be fixed.
This commit is contained in:
Nicholas Marriott
2009-11-05 08:45:08 +00:00
parent 80444436f3
commit b58bf49e91
4 changed files with 210 additions and 180 deletions

6
tmux.h
View File

@ -1002,7 +1002,9 @@ struct tty {
int term_flags;
struct timeval key_timer;
void (*key_callback)(int, struct mouse_event *, void *);
void *key_data;
struct event key_timer;
size_t ksize; /* maximum key size */
RB_HEAD(tty_keys, tty_key) ktree;
@ -1360,7 +1362,7 @@ int tty_keys_cmp(struct tty_key *, struct tty_key *);
RB_PROTOTYPE(tty_keys, tty_key, entry, tty_keys_cmp);
void tty_keys_init(struct tty *);
void tty_keys_free(struct tty *);
int tty_keys_next(struct tty *, int *, struct mouse_event *);
int tty_keys_next(struct tty *);
/* options-cmd.c */
const char *set_option_print(