summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2017-05-31 23:22:39 -0400
committerJesse Luehrs <doy@tozt.net>2017-06-01 03:16:10 -0400
commit0c83f7b826880f7bf909ba2b7f101a604b2ac8df (patch)
treea789857918c62989dee5223abaabfe0b2b25d8ab
parent1fbbf3965775648f188e191e9230e0921d7b37e3 (diff)
downloadlibvt100-0c83f7b826880f7bf909ba2b7f101a604b2ac8df.tar.gz
libvt100-0c83f7b826880f7bf909ba2b7f101a604b2ac8df.zip
implement any-event mouse tracking
-rw-r--r--src/parser.c7
-rw-r--r--src/parser.l7
-rw-r--r--src/screen.c10
-rw-r--r--src/screen.h3
4 files changed, 27 insertions, 0 deletions
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);