mirror of
https://github.com/tmux/tmux.git
synced 2024-11-01 07:08:49 +00:00
Adjust how Ctrl and Meta keys are sent to use standard representation if
available in mode 1, from Stanislav Kljuhhin, GitHub issue 4188.
This commit is contained in:
parent
71aa4fe767
commit
eb04f9314b
13
input-keys.c
13
input-keys.c
@ -543,12 +543,16 @@ input_key_mode1(struct bufferevent *bev, key_code key)
|
|||||||
|
|
||||||
log_debug("%s: key in %llx", __func__, key);
|
log_debug("%s: key in %llx", __func__, key);
|
||||||
|
|
||||||
|
/* A regular or shifted key + Meta. */
|
||||||
|
if ((key & (KEYC_CTRL | KEYC_META)) == KEYC_META)
|
||||||
|
return (input_key_vt10x(bev, key));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* As per
|
* As per
|
||||||
* https://invisible-island.net/xterm/modified-keys-us-pc105.html.
|
* https://invisible-island.net/xterm/modified-keys-us-pc105.html.
|
||||||
*/
|
*/
|
||||||
onlykey = key & KEYC_MASK_KEY;
|
onlykey = key & KEYC_MASK_KEY;
|
||||||
if ((key & (KEYC_META | KEYC_CTRL)) == KEYC_CTRL &&
|
if ((key & KEYC_CTRL) &&
|
||||||
(onlykey == ' ' ||
|
(onlykey == ' ' ||
|
||||||
onlykey == '/' ||
|
onlykey == '/' ||
|
||||||
onlykey == '@' ||
|
onlykey == '@' ||
|
||||||
@ -557,13 +561,6 @@ input_key_mode1(struct bufferevent *bev, key_code key)
|
|||||||
(onlykey >= '@' && onlykey <= '~')))
|
(onlykey >= '@' && onlykey <= '~')))
|
||||||
return (input_key_vt10x(bev, key));
|
return (input_key_vt10x(bev, key));
|
||||||
|
|
||||||
/*
|
|
||||||
* A regular key + Meta. In the absence of a standard to back this, we
|
|
||||||
* mimic what iTerm 2 does.
|
|
||||||
*/
|
|
||||||
if ((key & (KEYC_CTRL | KEYC_META)) == KEYC_META)
|
|
||||||
return (input_key_vt10x(bev, key));
|
|
||||||
|
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user