From b58bf49e913e61a4991c35257dd82e5dd4c907a2 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Thu, 5 Nov 2009 08:45:08 +0000 Subject: 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. --- tmux.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tmux.h') diff --git a/tmux.h b/tmux.h index f3263f4a..f1b0f7ac 100644 --- a/tmux.h +++ b/tmux.h @@ -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( -- cgit