summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/tmux.h
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2013-03-22 10:33:51 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2013-03-22 10:33:51 +0000
commitffac827263f4af2a6dc14c6618e570c44bd82a20 (patch)
tree5686d858420ea7f80aa2a8c34381a1e2b19901af /usr.bin/tmux/tmux.h
parente223112e51a632f343e0df6d1c985e779a98f0a6 (diff)
Support the latest theory for mouse input, this is enabled/disabled with
SM/RM 1006 and is similar in style to SGR input: \033[<b;x;yM or \033[b;x;ym. From Egmont Koblinger.
Diffstat (limited to 'usr.bin/tmux/tmux.h')
-rw-r--r--usr.bin/tmux/tmux.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index 52ed2e5773f..a4f022ec2e9 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.383 2013/03/21 18:47:56 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.384 2013/03/22 10:33:50 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -665,7 +665,8 @@ struct mode_key_table {
#define MODE_MOUSE_BUTTON 0x40
#define MODE_MOUSE_ANY 0x80
#define MODE_MOUSE_UTF8 0x100
-#define MODE_BRACKETPASTE 0x200
+#define MODE_MOUSE_SGR 0x200
+#define MODE_BRACKETPASTE 0x400
#define ALL_MOUSE_MODES (MODE_MOUSE_STANDARD|MODE_MOUSE_BUTTON|MODE_MOUSE_ANY)
@@ -1153,6 +1154,9 @@ LIST_HEAD(tty_terms, tty_term);
* - bits 3, 4 and 5 are for keys
* - bit 6 is set for dragging
* - bit 7 for buttons 4 and 5
+ *
+ * With the SGR 1006 extension the released button becomes known. Store these
+ * in separate fields and store the value converted to the old format in xb.
*/
struct mouse_event {
u_int xb;
@@ -1165,6 +1169,10 @@ struct mouse_event {
u_int ly;
u_int sy;
+ u_int sgr; /* whether the input arrived in SGR format */
+ u_int sgr_xb; /* only for SGR: the unmangled button */
+ u_int sgr_rel; /* only for SGR: whether it is a release event */
+
u_int button;
u_int clicks;