summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/tmux.h
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2020-05-16 16:35:13 +0000
committernicm <nicm@openbsd.org>2020-05-16 16:35:13 +0000
commit5416581e0b94b173c3d9362360b6a4da2992baac (patch)
treec59f33feeea143bf688e855caa04cdbdb1c0d8de /usr.bin/tmux/tmux.h
parentRename KEYC_ESCAPE to KEYC_META. (diff)
downloadwireguard-openbsd-5416581e0b94b173c3d9362360b6a4da2992baac.tar.xz
wireguard-openbsd-5416581e0b94b173c3d9362360b6a4da2992baac.zip
Separate key flags and modifiers, log key flags, make the "xterm" flag
more explicit and fix M- keys with a leading escape.
Diffstat (limited to 'usr.bin/tmux/tmux.h')
-rw-r--r--usr.bin/tmux/tmux.h38
1 files changed, 21 insertions, 17 deletions
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index 771f6a46fcc..de896a47d46 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.1045 2020/05/16 16:33:16 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.1046 2020/05/16 16:35:13 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -112,27 +112,31 @@ struct winlink;
#define VISUAL_BOTH 2
/* Special key codes. */
-#define KEYC_NONE 0x00ff000000000ULL
-#define KEYC_UNKNOWN 0x00fe000000000ULL
-#define KEYC_BASE 0x0001000000000ULL
-#define KEYC_USER 0x0002000000000ULL
+#define KEYC_NONE 0x00ff000000000ULL
+#define KEYC_UNKNOWN 0x00fe000000000ULL
+#define KEYC_BASE 0x0001000000000ULL
+#define KEYC_USER 0x0002000000000ULL
/* Key modifier bits. */
-#define KEYC_META 0x0100000000000ULL
-#define KEYC_CTRL 0x0200000000000ULL
-#define KEYC_SHIFT 0x0400000000000ULL
-#define KEYC_XTERM 0x0800000000000ULL
-#define KEYC_LITERAL 0x1000000000000ULL
-#define KEYC_KEYPAD 0x2000000000000ULL
-#define KEYC_CURSOR 0x4000000000000ULL
+#define KEYC_META 0x00100000000000ULL
+#define KEYC_CTRL 0x00200000000000ULL
+#define KEYC_SHIFT 0x00400000000000ULL
+
+/* Key flag bits. */
+#define KEYC_LITERAL 0x01000000000000ULL
+#define KEYC_KEYPAD 0x02000000000000ULL
+#define KEYC_CURSOR 0x04000000000000ULL
+#define KEYC_IMPLIED_META 0x08000000000000ULL
+#define KEYC_BUILD_MODIFIERS 0x10000000000000ULL
+
+/* Masks for key bits. */
+#define KEYC_MASK_MODIFIERS 0x00f00000000000ULL
+#define KEYC_MASK_FLAGS 0xff000000000000ULL
+#define KEYC_MASK_KEY 0x000fffffffffffULL
/* Available user keys. */
#define KEYC_NUSER 1000
-/* Mask to obtain key w/o modifiers. */
-#define KEYC_MASK_MOD 0xff00000000000ULL
-#define KEYC_MASK_KEY 0x00fffffffffffULL
-
/* Is this a mouse key? */
#define KEYC_IS_MOUSE(key) (((key) & KEYC_MASK_KEY) >= KEYC_MOUSE && \
((key) & KEYC_MASK_KEY) < KEYC_BSPACE)
@@ -2284,7 +2288,7 @@ struct cmdq_item *key_bindings_dispatch(struct key_binding *,
/* key-string.c */
key_code key_string_lookup_string(const char *);
-const char *key_string_lookup_key(key_code);
+const char *key_string_lookup_key(key_code, int);
/* alerts.c */
void alerts_reset_all(void);