=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/tty-keys.c,v retrieving revision 1.14 retrieving revision 1.15 diff -c -r1.14 -r1.15 *** src/usr.bin/tmux/tty-keys.c 2009/11/05 08:45:08 1.14 --- src/usr.bin/tmux/tty-keys.c 2009/11/05 10:44:36 1.15 *************** *** 1,4 **** ! /* $OpenBSD: tty-keys.c,v 1.14 2009/11/05 08:45:08 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: tty-keys.c,v 1.15 2009/11/05 10:44:36 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 29,35 **** * Handle keys input from the outside terminal. */ ! void tty_keys_add(struct tty *, const char *, int, int); void tty_keys_callback(int, short, void *); int tty_keys_mouse(char *, size_t, size_t *, struct mouse_event *); --- 29,35 ---- * Handle keys input from the outside terminal. */ ! void tty_keys_add(struct tty *, const char *, int); void tty_keys_callback(int, short, void *); int tty_keys_mouse(char *, size_t, size_t *, struct mouse_event *); *************** *** 39,44 **** --- 39,46 ---- int key; int flags; + #define TTYKEY_CTRL 0x1 + #define TTYKEY_RAW 0x2 }; struct tty_key_ent tty_keys[] = { *************** *** 195,208 **** } void ! tty_keys_add(struct tty *tty, const char *s, int key, int flags) { struct tty_key *tk, *tl; tk = xmalloc(sizeof *tk); tk->string = xstrdup(s); tk->key = key; - tk->flags = flags; if ((tl = RB_INSERT(tty_keys, &tty->ktree, tk)) != NULL) { xfree(tk->string); --- 197,209 ---- } void ! tty_keys_add(struct tty *tty, const char *s, int key) { struct tty_key *tk, *tl; tk = xmalloc(sizeof *tk); tk->string = xstrdup(s); tk->key = key; if ((tl = RB_INSERT(tty_keys, &tty->ktree, tk)) != NULL) { xfree(tk->string); *************** *** 240,251 **** continue; } ! tty_keys_add(tty, s + 1, tke->key, tke->flags); if (tke->flags & TTYKEY_CTRL) { if (strlcpy(tmp, s, sizeof tmp) >= sizeof tmp) continue; tmp[strlen(tmp) - 1] ^= 0x20; ! tty_keys_add(tty, tmp + 1, tke->key | KEYC_CTRL, 0); } } } --- 241,252 ---- continue; } ! tty_keys_add(tty, s + 1, tke->key); if (tke->flags & TTYKEY_CTRL) { if (strlcpy(tmp, s, sizeof tmp) >= sizeof tmp) continue; tmp[strlen(tmp) - 1] ^= 0x20; ! tty_keys_add(tty, tmp + 1, tke->key | KEYC_CTRL); } } }