[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Potential mouseinterval() bug/feature
From: |
Byron Stanoszek |
Subject: |
Potential mouseinterval() bug/feature |
Date: |
Tue, 2 Oct 2001 07:47:08 -0400 (EDT) |
I use the mouseinterval() feature with an argument of 0 to specify the least
minimum time possible to coalesce mouse events into a MOUSE_CLICK event. This
works very well for applications which are only looking for MOUSE_PRESS and
MOUSE_RELEASE events on the local machine.
The moment I try to use this application over a slow network connection,
sometimes both packets get received by ncurses at the same time and the events
are condensed into a MOUSE_CLICK. Having a mousemask set to ignore anything but
Button1 press and release events, the click results in no event sent to the
remote application program.
I propose that a value of 0 for mouseinterval() skips the event-condensing
stage and returns each press/release event as it happens. If this is
unacceptable (i.e. may break existing programs), then a special value of -1 or
a new function should be created to support this feature. Otherwise ncurses has
no ability to turn off mouse clicks for applications that only support a touch-
screen-like behavior.
This patch worked for me to skip condensing events for a value of 0:
--- ncurses-5.2/ncurses/base/lib_getch.c.old Mon Oct 1 10:45:01 2001
+++ ncurses-5.2/ncurses/base/lib_getch.c Mon Oct 1 11:18:05 2001
@@ -233,6 +233,8 @@
if (SP->_mouse_inline(SP))
break;
}
+ if(!SP->_maxclick)
+ break;
} while
(ch == KEY_MOUSE
&& (_nc_timed_wait(3, SP->_maxclick, (int *) 0)
Thanks for your time,
-Byron
--
Byron Stanoszek Ph: (330) 644-3059
Systems Programmer Fax: (330) 644-8110
Commercial Timesharing Inc. Email: address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Potential mouseinterval() bug/feature,
Byron Stanoszek <=