From 0c83f7b826880f7bf909ba2b7f101a604b2ac8df Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 31 May 2017 23:22:39 -0400 Subject: implement any-event mouse tracking --- src/parser.c | 7 +++++++ src/parser.l | 7 +++++++ src/screen.c | 10 ++++++++++ src/screen.h | 3 +++ 4 files changed, 27 insertions(+) (limited to 'src') diff --git a/src/parser.c b/src/parser.c index c13dfd1..4eeea45 100644 --- a/src/parser.c +++ b/src/parser.c @@ -2728,6 +2728,7 @@ static void vt100_parser_handle_ris(VT100Screen *vt) vt100_screen_reset_mouse_reporting_press(vt); vt100_screen_reset_mouse_reporting_press_release(vt); vt100_screen_reset_mouse_reporting_button_motion(vt); + vt100_screen_reset_mouse_reporting_any_motion(vt); vt100_screen_reset_mouse_reporting_sgr_mode(vt); vt100_screen_reset_bracketed_paste(vt); vt100_screen_reset_origin_mode(vt); @@ -3050,6 +3051,9 @@ static void vt100_parser_handle_sm(VT100Screen *vt, char *buf, size_t len) case 1002: vt100_screen_set_mouse_reporting_button_motion(vt); break; + case 1003: + vt100_screen_set_mouse_reporting_any_motion(vt); + break; case 1006: vt100_screen_set_mouse_reporting_sgr_mode(vt); break; @@ -3124,6 +3128,9 @@ static void vt100_parser_handle_rm(VT100Screen *vt, char *buf, size_t len) case 1002: vt100_screen_reset_mouse_reporting_button_motion(vt); break; + case 1003: + vt100_screen_reset_mouse_reporting_any_motion(vt); + break; case 1006: vt100_screen_reset_mouse_reporting_sgr_mode(vt); break; diff --git a/src/parser.l b/src/parser.l index 573e387..5c0452c 100644 --- a/src/parser.l +++ b/src/parser.l @@ -333,6 +333,7 @@ static void vt100_parser_handle_ris(VT100Screen *vt) vt100_screen_reset_mouse_reporting_press(vt); vt100_screen_reset_mouse_reporting_press_release(vt); vt100_screen_reset_mouse_reporting_button_motion(vt); + vt100_screen_reset_mouse_reporting_any_motion(vt); vt100_screen_reset_mouse_reporting_sgr_mode(vt); vt100_screen_reset_bracketed_paste(vt); vt100_screen_reset_origin_mode(vt); @@ -655,6 +656,9 @@ static void vt100_parser_handle_sm(VT100Screen *vt, char *buf, size_t len) case 1002: vt100_screen_set_mouse_reporting_button_motion(vt); break; + case 1003: + vt100_screen_set_mouse_reporting_any_motion(vt); + break; case 1006: vt100_screen_set_mouse_reporting_sgr_mode(vt); break; @@ -729,6 +733,9 @@ static void vt100_parser_handle_rm(VT100Screen *vt, char *buf, size_t len) case 1002: vt100_screen_reset_mouse_reporting_button_motion(vt); break; + case 1003: + vt100_screen_reset_mouse_reporting_any_motion(vt); + break; case 1006: vt100_screen_reset_mouse_reporting_sgr_mode(vt); break; diff --git a/src/screen.c b/src/screen.c index e031e3e..3e3f2ab 100644 --- a/src/screen.c +++ b/src/screen.c @@ -822,6 +822,16 @@ void vt100_screen_reset_mouse_reporting_button_motion(VT100Screen *vt) vt->mouse_reporting_button_motion = 0; } +void vt100_screen_set_mouse_reporting_any_motion(VT100Screen *vt) +{ + vt->mouse_reporting_any_motion = 1; +} + +void vt100_screen_reset_mouse_reporting_any_motion(VT100Screen *vt) +{ + vt->mouse_reporting_any_motion = 0; +} + void vt100_screen_set_mouse_reporting_sgr_mode(VT100Screen *vt) { vt->mouse_reporting_sgr_mode = 1; diff --git a/src/screen.h b/src/screen.h index 9a4f24e..e28eaa8 100644 --- a/src/screen.h +++ b/src/screen.h @@ -95,6 +95,7 @@ struct vt100_screen { unsigned int mouse_reporting_press: 1; unsigned int mouse_reporting_press_release: 1; unsigned int mouse_reporting_button_motion: 1; + unsigned int mouse_reporting_any_motion: 1; unsigned int mouse_reporting_sgr_mode: 1; unsigned int bracketed_paste: 1; unsigned int origin_mode: 1; @@ -175,6 +176,8 @@ void vt100_screen_set_mouse_reporting_press_release(VT100Screen *vt); void vt100_screen_reset_mouse_reporting_press_release(VT100Screen *vt); void vt100_screen_set_mouse_reporting_button_motion(VT100Screen *vt); void vt100_screen_reset_mouse_reporting_button_motion(VT100Screen *vt); +void vt100_screen_set_mouse_reporting_any_motion(VT100Screen *vt); +void vt100_screen_reset_mouse_reporting_any_motion(VT100Screen *vt); void vt100_screen_set_mouse_reporting_sgr_mode(VT100Screen *vt); void vt100_screen_reset_mouse_reporting_sgr_mode(VT100Screen *vt); void vt100_screen_set_bracketed_paste(VT100Screen *vt); -- cgit v1.2.3-54-g00ecf