summaryrefslogtreecommitdiffstats
path: root/osdep/terminal.h
diff options
context:
space:
mode:
authornanahi <130121847+na-na-hi@users.noreply.github.com>2024-03-01 23:42:22 -0500
committerKacper Michajłow <kasper93@gmail.com>2024-04-18 01:03:33 +0200
commit9ae58ba186ca58b80f0453e76c75015f471beb05 (patch)
treee4a7288ef3211b0835a0567982ac212ccd5fb5ca /osdep/terminal.h
parent805577c79274d1f3acda02904a13273d84770fa1 (diff)
downloadmpv-9ae58ba186ca58b80f0453e76c75015f471beb05.tar.bz2
mpv-9ae58ba186ca58b80f0453e76c75015f471beb05.tar.xz
terminal-unix: support mouse escape codes
These 6-byte codes have the format of \e [ M <button> <xpos> <ypos>. Support the first 3 mouse bottons + scroll up/down for now as button numbers > 5 are pretty non-portable across terminals. Pixel-based mouse position values are calculated and sent to the input system.
Diffstat (limited to 'osdep/terminal.h')
-rw-r--r--osdep/terminal.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/osdep/terminal.h b/osdep/terminal.h
index c83b0a26ca..6d12647035 100644
--- a/osdep/terminal.h
+++ b/osdep/terminal.h
@@ -35,6 +35,9 @@
#define TERM_ESC_ALT_SCREEN "\033[?1049h"
#define TERM_ESC_NORMAL_SCREEN "\033[?1049l"
+#define TERM_ESC_ENABLE_MOUSE "\033[?1003h"
+#define TERM_ESC_DISABLE_MOUSE "\033[?1003l"
+
struct input_ctx;
/* Global initialization for terminal output. */