summaryrefslogtreecommitdiffstats
path: root/src/globals.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-11-23 20:20:18 +0000
committerBram Moolenaar <Bram@vim.org>2022-11-23 20:20:18 +0000
commit63a2e360cca2c70ab0a85d14771d3259d4b3aafa (patch)
tree9f0d9131e530cf658c2b7bf05e16539a1ebb0a28 /src/globals.h
parent0b6d6a186e961faa5b9058406234ffd93a7e6688 (diff)
patch 9.0.0930: cannot debug the Kitty keyboard protocol with TermDebugv9.0.0930
Problem: Cannot debug the Kitty keyboard protocol with TermDebug. Solution: Add Kitty keyboard protocol support to the libvterm fork. Recognize the escape sequences that the protocol generates. Add the 'keyprotocol' option to allow the user to specify for which terminal what protocol is to be used, instead of hard-coding this. Add recognizing the kitty keyboard protocol status.
Diffstat (limited to 'src/globals.h')
-rw-r--r--src/globals.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/globals.h b/src/globals.h
index 9d70da6ca8..a5e3982093 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -1377,6 +1377,24 @@ EXTERN int pending_end_reg_executing INIT(= 0);
// no longer be used.
EXTERN int seenModifyOtherKeys INIT(= FALSE);
+// The state for the Kitty keyboard protocol.
+typedef enum {
+ // Initially we have no clue if the protocol is on or off.
+ KKPS_INITIAL,
+ // Used when receiving the state and the flags are zero.
+ KKPS_OFF,
+ // Used when receiving the state and the flags are non-zero.
+ KKPS_ENABLED,
+ // Used after outputting t_KE when the state was KKPS_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.
+ KKPS_DISABLED,
+ // Used after outputting t_KE when the state was not KKPS_ENABLED.
+ KKPS_AFTER_T_KE,
+} kkpstate_T;
+
+EXTERN kkpstate_T kitty_protocol_state INIT(= KKPS_INITIAL);
+
EXTERN int no_mapping INIT(= FALSE); // currently no mapping allowed
EXTERN int no_zero_mapping INIT(= 0); // mapping zero not allowed
EXTERN int allow_keys INIT(= FALSE); // allow key codes when no_mapping