diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2017-01-11 22:36:08 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2017-01-11 22:36:08 +0000 |
commit | 291fee9dfbf05f085b7e77442afa0b36cc86a19f (patch) | |
tree | 6926e3daae102ffe258a1113198bc28682ae00a5 /usr.bin/tmux | |
parent | 69c3226d7288daf6689c5b1d58c9c38a83a7b742 (diff) |
Add some missing special keys to key_string_lookup_key, fix a mouse
check in server_client_handle_key, and tweak a comment.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r-- | usr.bin/tmux/key-string.c | 8 | ||||
-rw-r--r-- | usr.bin/tmux/server-client.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/tty.c | 6 |
3 files changed, 11 insertions, 7 deletions
diff --git a/usr.bin/tmux/key-string.c b/usr.bin/tmux/key-string.c index f13eb90e636..9c7d2ec855b 100644 --- a/usr.bin/tmux/key-string.c +++ b/usr.bin/tmux/key-string.c @@ -1,4 +1,4 @@ -/* $OpenBSD: key-string.c,v 1.42 2017/01/05 09:07:16 nicm Exp $ */ +/* $OpenBSD: key-string.c,v 1.43 2017/01/11 22:36:07 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -247,8 +247,14 @@ key_string_lookup_key(key_code key) /* Handle special keys. */ if (key == KEYC_UNKNOWN) return ("Unknown"); + if (key == KEYC_FOCUS_IN) + return ("FocusIn"); + if (key == KEYC_FOCUS_OUT) + return ("FocusOut"); if (key == KEYC_MOUSE) return ("Mouse"); + if (key == KEYC_DRAGGING) + return ("Dragging"); /* * Special case: display C-@ as C-Space. Could do this below in diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c index 19fecb3a14c..aa808a2d129 100644 --- a/usr.bin/tmux/server-client.c +++ b/usr.bin/tmux/server-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-client.c,v 1.205 2016/12/07 09:16:13 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.206 2017/01/11 22:36:07 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -758,7 +758,7 @@ server_client_handle_key(struct client *c, key_code key) wp = w->active; /* Forward mouse keys if disabled. */ - if (key == KEYC_MOUSE && !options_get_number(s->options, "mouse")) + if (KEYC_IS_MOUSE(key) && !options_get_number(s->options, "mouse")) goto forward; /* Treat everything as a regular key when pasting is detected. */ diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c index 5c10d3beaeb..76b768fc95e 100644 --- a/usr.bin/tmux/tty.c +++ b/usr.bin/tmux/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.220 2017/01/11 16:09:57 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.221 2017/01/11 22:36:07 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -565,9 +565,7 @@ tty_update_mode(struct tty *tty, int mode, struct screen *s) if (mode & ALL_MOUSE_MODES) { /* * Enable the SGR (1006) extension unconditionally, as - * this is safe from misinterpretation. Do it in this - * order, because in some terminals it's the last one - * that takes effect and SGR is the preferred one. + * it is safe from misinterpretation. */ tty_puts(tty, "\033[?1006h"); if (mode & MODE_MOUSE_BUTTON) |