summaryrefslogtreecommitdiffstats
path: root/src/globals.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-11-26 19:16:48 +0000
committerBram Moolenaar <Bram@vim.org>2022-11-26 19:16:48 +0000
commitc255b789653120979eacdf8bb8eca02487753a8e (patch)
tree50a07d7bcbac6a0331c47ed4da72f137cdb5b2e5 /src/globals.h
parent837ca8f43b9d6b8574a2bfdae219b17c84411730 (diff)
patch 9.0.0954: cannot detect whether modifyOtherKeys is enabledv9.0.0954
Problem: Cannot detect whether modifyOtherKeys is enabled. Solution: Use XTQMODKEYS introduced by xterm version 377 to request the modifyOtherKeys level. Update the keycode check results.
Diffstat (limited to 'src/globals.h')
-rw-r--r--src/globals.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/globals.h b/src/globals.h
index a5e3982093..d9207b940f 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -1374,9 +1374,29 @@ EXTERN int reg_executing INIT(= 0); // register being executed or zero
EXTERN int pending_end_reg_executing INIT(= 0);
// Set when a modifyOtherKeys sequence was seen, then simplified mappings will
-// no longer be used.
+// no longer be used. To be combined with modify_otherkeys_state.
EXTERN int seenModifyOtherKeys INIT(= FALSE);
+// The state for the modifyOtherKeys level
+typedef enum {
+ // Initially we have no clue if the protocol is on or off.
+ MOKS_INITIAL,
+ // Used when receiving the state and the level is not two.
+ MOKS_OFF,
+ // Used when receiving the state and the level is two.
+ MOKS_ENABLED,
+ // Used after outputting t_KE when the state was MOKS_ENABLED. We do not
+ // really know if t_KE actually disabled the protocol, the following t_KI
+ // is expected to request the state, but the response may come only later.
+ MOKS_DISABLED,
+ // Used after outputting t_KE when the state was not MOKS_ENABLED.
+ MOKS_AFTER_T_KE,
+} mokstate_T;
+
+// Set when a response to XTQMODKEYS was received. Only works for xterm
+// version 377 and later.
+EXTERN mokstate_T modify_otherkeys_state INIT(= MOKS_INITIAL);
+
// The state for the Kitty keyboard protocol.
typedef enum {
// Initially we have no clue if the protocol is on or off.