fix mouse support so that it really ignores everything except releases
of button 1 (i.e, left clicks) git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3686 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
f23cc46655
commit
98e4d4f3b1
|
@ -5,6 +5,9 @@ CVS code -
|
||||||
only optional value. Also fix a wording problem in
|
only optional value. Also fix a wording problem in
|
||||||
-W/--wordbounds. Changes to usage(), nano.1, nanorc.5,
|
-W/--wordbounds. Changes to usage(), nano.1, nanorc.5,
|
||||||
rnano.1, nano.texi, and nanorc.sample.in. (DLR)
|
rnano.1, nano.texi, and nanorc.sample.in. (DLR)
|
||||||
|
- Fix mouse support so that it really ignores everything except
|
||||||
|
releases of button 1 (i.e, left clicks). Changes to
|
||||||
|
enable_mouse_support() and get_mouseinput(). (DLR)
|
||||||
- doc/syntax/c.nanorc:
|
- doc/syntax/c.nanorc:
|
||||||
- Since .i and .ii are preprocessed C and C++ output, colorize
|
- Since .i and .ii are preprocessed C and C++ output, colorize
|
||||||
them here. (Mike Frysinger)
|
them here. (Mike Frysinger)
|
||||||
|
|
|
@ -674,7 +674,7 @@ void disable_mouse_support(void)
|
||||||
/* Enable mouse support. */
|
/* Enable mouse support. */
|
||||||
void enable_mouse_support(void)
|
void enable_mouse_support(void)
|
||||||
{
|
{
|
||||||
mousemask(BUTTON1_RELEASED, NULL);
|
mousemask(ALL_MOUSE_EVENTS, NULL);
|
||||||
mouseinterval(50);
|
mouseinterval(50);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1520,6 +1520,11 @@ bool get_mouseinput(int *mouse_x, int *mouse_y, bool allow_shortcuts)
|
||||||
if (getmouse(&mevent) == ERR)
|
if (getmouse(&mevent) == ERR)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
/* If it's not a release of the first mouse button (i.e, a left
|
||||||
|
* click), get out. */
|
||||||
|
if (!(mevent.bstate & BUTTON1_RELEASED))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
/* Save the screen coordinates where the mouse event took place. */
|
/* Save the screen coordinates where the mouse event took place. */
|
||||||
*mouse_x = mevent.x;
|
*mouse_x = mevent.x;
|
||||||
*mouse_y = mevent.y;
|
*mouse_y = mevent.y;
|
||||||
|
|
Loading…
Reference in New Issue