From e5fc266cdbd032b094ce487c0f2a6b9b44371c32 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Fri, 5 Jul 2019 14:24:51 +0200 Subject: vt: add support for \E[?1000h - report mouse button events --- terminal.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'terminal.h') diff --git a/terminal.h b/terminal.h index 4c1e604e..2aa8699e 100644 --- a/terminal.h +++ b/terminal.h @@ -151,6 +151,23 @@ enum decckm { DECCKM_CSI, DECCKM_SS3 }; enum keypad_mode { KEYPAD_NUMERICAL, KEYPAD_APPLICATION }; enum charset { CHARSET_ASCII, CHARSET_GRAPHIC }; +/* *What* to report */ +enum mouse_tracking { + MOUSE_NONE, + MOUSE_X10, /* ?9h */ + MOUSE_CLICK, /* ?1000h - report mouse clicks*/ + MOUSE_DRAG, /* ?1002h - report clicks and drag motions */ + MOUSE_MOTION, /* ?1003h - report clicks and motion*/ +}; + +/* *How* to report */ +enum mouse_reporting { + MOUSE_NORMAL, + MOUSE_UTF8, /* ?1005h */ + MOUSE_SGR, /* ?1006h */ + MOUSE_URXVT, /* ?1015h */ +}; + struct terminal { pid_t slave; int ptmx; @@ -162,6 +179,8 @@ struct terminal { bool auto_margin; bool insert_mode; bool bracketed_paste; + enum mouse_tracking mouse_tracking; + enum mouse_reporting mouse_reporting; int selected_charset; enum charset charset[4]; /* G0-G3 */ @@ -226,3 +245,8 @@ void term_scroll_reverse_partial( struct terminal *term, struct scroll_region region, int rows); int term_cursor_linear(const struct terminal *term, int row, int col); + +void term_mouse_down(struct terminal *term, int button, int row, int col, + bool shift, bool alt, bool ctrl); +void term_mouse_up(struct terminal *term, int button, int row, int col, + bool shift, bool alt, bool ctrl); -- cgit v1.3