=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/tty-keys.c,v retrieving revision 1.26 retrieving revision 1.27 diff -c -r1.26 -r1.27 *** src/usr.bin/tmux/tty-keys.c 2009/12/01 07:59:40 1.26 --- src/usr.bin/tmux/tty-keys.c 2009/12/03 22:50:10 1.27 *************** *** 1,4 **** ! /* $OpenBSD: tty-keys.c,v 1.26 2009/12/01 07:59:40 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: tty-keys.c,v 1.27 2009/12/03 22:50:10 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 35,41 **** void tty_keys_add(struct tty *, const char *, int); void tty_keys_free1(struct tty_key *); struct tty_key *tty_keys_find1( ! struct tty_key *, const char *, size_t, size_t *); struct tty_key *tty_keys_find(struct tty *, const char *, size_t, size_t *); void tty_keys_callback(int, short, void *); int tty_keys_mouse( --- 35,41 ---- void tty_keys_add(struct tty *, const char *, int); void tty_keys_free1(struct tty_key *); struct tty_key *tty_keys_find1( ! struct tty_key *, const char *, size_t, size_t *); struct tty_key *tty_keys_find(struct tty *, const char *, size_t, size_t *); void tty_keys_callback(int, short, void *); int tty_keys_mouse( *************** *** 50,56 **** #define TTYKEY_RAW 0x1 }; ! /* * Default key tables. Those flagged with TTYKEY_RAW are inserted directly, * otherwise they are looked up in terminfo(5). */ --- 50,56 ---- #define TTYKEY_RAW 0x1 }; ! /* * Default key tables. Those flagged with TTYKEY_RAW are inserted directly, * otherwise they are looked up in terminfo(5). */ *************** *** 319,325 **** /* Use the child tree for the next character. */ tkp = &tk->next; ! } else { if (*s < tk->ch) tkp = &tk->left; else if (*s > tk->ch) --- 319,325 ---- /* Use the child tree for the next character. */ tkp = &tk->next; ! } else { if (*s < tk->ch) tkp = &tk->left; else if (*s > tk->ch) *************** *** 374,380 **** if (tk->right != NULL) tty_keys_free1(tk->right); xfree(tk); ! } /* Lookup a key in the tree. */ --- 374,380 ---- if (tk->right != NULL) tty_keys_free1(tk->right); xfree(tk); ! } /* Lookup a key in the tree. */ *************** *** 523,533 **** /* Start the timer and wait for expiry or more data. */ tv.tv_sec = 0; tv.tv_usec = ESCAPE_PERIOD * 1000L; ! evtimer_del(&tty->key_timer); evtimer_set(&tty->key_timer, tty_keys_callback, tty); evtimer_add(&tty->key_timer, &tv); ! tty->flags |= TTY_ESCAPE; return (0); --- 523,533 ---- /* Start the timer and wait for expiry or more data. */ tv.tv_sec = 0; tv.tv_usec = ESCAPE_PERIOD * 1000L; ! evtimer_del(&tty->key_timer); evtimer_set(&tty->key_timer, tty_keys_callback, tty); evtimer_add(&tty->key_timer, &tv); ! tty->flags |= TTY_ESCAPE; return (0); *************** *** 548,554 **** goto handle_key; handle_key: ! evtimer_del(&tty->key_timer); tty->key_callback(key, &mouse, tty->key_data); --- 548,554 ---- goto handle_key; handle_key: ! evtimer_del(&tty->key_timer); tty->key_callback(key, &mouse, tty->key_data); *************** *** 570,576 **** ; } ! /* * Handle mouse key input. Returns 0 for success, -1 for failure, 1 for partial * (probably a mouse sequence but need more data). */ --- 570,576 ---- ; } ! /* * Handle mouse key input. Returns 0 for success, -1 for failure, 1 for partial * (probably a mouse sequence but need more data). */ *************** *** 593,599 **** return (-1); if (len == 2) return (1); ! if (buf[2] != 'M') return (-1); if (len == 3) --- 593,599 ---- return (-1); if (len == 2) return (1); ! if (buf[2] != 'M') return (-1); if (len == 3)