From 9ac5ed8d4ef7aea77ffb892a09b4d28d847d8d56 Mon Sep 17 00:00:00 2001 From: Leonard den Ottolander Date: Wed, 28 Sep 2005 17:21:53 +0000 Subject: [PATCH] * key.c (xmouse_get_event): Catch GPM_DRAG event. * mouse.c (enable_mouse, disable_mouse): Update printed escape sequence. --- src/ChangeLog | 6 ++++++ src/key.c | 7 ++++++- src/mouse.c | 4 ++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index a3e4e66f2..d495553cf 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2005-09-28 Pavel Tsekov + + * key.c (xmouse_get_event): Catch GPM_DRAG event. + * mouse.c (enable_mouse, disable_mouse): Update printed escape + sequence. + 2005-09-17 Pavel Tsekov * execute.c (do_execute): Flush stdout after printing the diff --git a/src/key.c b/src/key.c index 16287c428..74626569b 100644 --- a/src/key.c +++ b/src/key.c @@ -512,7 +512,12 @@ xmouse_get_event (Gpm_Event *ev) ev->type = 0; } } else { - ev->type = GPM_DOWN; + if (btn >= 32 && btn <= 34) { + btn -= 32; + ev->type = GPM_DRAG; + } else + ev->type = GPM_DOWN; + GET_TIME (tv2); if (tv1.tv_sec && (DIF_TIME (tv1,tv2) < double_click_speed)){ clicks++; diff --git a/src/mouse.c b/src/mouse.c index b3edced99..c7a233b90 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -91,7 +91,7 @@ void enable_mouse (void) printf(ESC_STR "[?1001s"); /* enable mouse tracking */ - printf(ESC_STR "[?1000h"); + printf(ESC_STR "[?1002h"); fflush (stdout); mouse_enabled = 1; @@ -117,7 +117,7 @@ void disable_mouse (void) #endif case MOUSE_XTERM: /* disable mouse tracking */ - printf(ESC_STR "[?1000l"); + printf(ESC_STR "[?1002l"); /* restore old highlight mouse tracking */ printf(ESC_STR "[?1001r");