summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/server-client.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2020-02-19 14:25:01 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2020-02-19 14:25:01 +0000
commit309f5b1fb2c7f0ee8fe7491b2c3373507a4eea51 (patch)
tree2e6fc977d4b742ba5294ba011c52d2e3be7c8d55 /usr.bin/tmux/server-client.c
parent9f0cc5592f9232254f591a5e77ba99cfc34fe831 (diff)
A few fixes to make modifier keys and dragging work - need to remove the
modifiers before checking for the dragging marker key, and apply them before looking up the end key. Also fix key-to-string with modifiers for special keys.
Diffstat (limited to 'usr.bin/tmux/server-client.c')
-rw-r--r--usr.bin/tmux/server-client.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c
index 46e6cc95cdf..c4ea4b85f4e 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.304 2020/02/11 07:01:08 nicm Exp $ */
+/* $OpenBSD: server-client.c,v 1.305 2020/02/19 14:25:00 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -662,8 +662,7 @@ have_event:
break;
}
c->tty.mouse_drag_flag = 0;
-
- return (key);
+ goto out;
}
/* Convert to a key binding. */
@@ -958,6 +957,7 @@ have_event:
if (key == KEYC_UNKNOWN)
return (KEYC_UNKNOWN);
+out:
/* Apply modifiers if any. */
if (b & MOUSE_MASK_META)
key |= KEYC_ESCAPE;
@@ -966,6 +966,8 @@ have_event:
if (b & MOUSE_MASK_SHIFT)
key |= KEYC_SHIFT;
+ if (log_get_level() != 0)
+ log_debug("mouse key is %s", key_string_lookup_key (key));
return (key);
}
@@ -1059,7 +1061,7 @@ server_client_key_callback(struct cmdq_item *item, void *data)
* Mouse drag is in progress, so fire the callback (now that
* the mouse event is valid).
*/
- if (key == KEYC_DRAGGING) {
+ if ((key & KEYC_MASK_KEY) == KEYC_DRAGGING) {
c->tty.mouse_drag_update(c, m);
goto out;
}