diff options
author | nicm <nicm> | 2020-02-19 14:25:00 +0000 |
---|---|---|
committer | nicm <nicm> | 2020-02-19 14:25:00 +0000 |
commit | b20753f2a302d07829549dfbd249bd210374fec4 (patch) | |
tree | bc975a68e6e539a227a6fc94b584bdcf5d85578b /server-client.c | |
parent | a1f6bd55b652cd1658a005f96bbb667d637fe347 (diff) | |
download | rtmux-b20753f2a302d07829549dfbd249bd210374fec4.tar.gz rtmux-b20753f2a302d07829549dfbd249bd210374fec4.tar.bz2 rtmux-b20753f2a302d07829549dfbd249bd210374fec4.zip |
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 'server-client.c')
-rw-r--r-- | server-client.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/server-client.c b/server-client.c index 864c2e6a..123cc531 100644 --- a/server-client.c +++ b/server-client.c @@ -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; } |