[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mouse button handling

From: Damien Guibouret
Subject: Re: Mouse button handling
Date: Sun, 11 Sep 2011 20:44:12 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050416

Thomas Dickey wrote:
On Thu, Sep 08, 2011 at 12:56:23AM +0200, Damien Guibouret wrote:


Here is the updated diff that adds the mouse event queue compaction to what I already sent. In addition to that, getmouse checks if event is in requested mask or not as there could be cases where KEY_MOUSE is returned without the _nc_mouse_parse function being called (if _nc_mouse_inline returns FALSE). If it is not in the mask it checks previous event until getting a requested one or an invalid event (in this last case it returns ERR). I modified also the test/ncurses.c also to dump the whole queue when a mouse key is detected.

hmm - some of it is interesting.  But after applying the change, it's still not
working properly for me.  So my patch tonight reverts the (relatively small)
change from early 2010 which is the basic issue, and we can pick apart this
Generally what I saw: the display in test/ncurses in response to mouse-4
(wheel-mouse-up) is clearing parts of the lines.  The "*" expected to show
in response to mouse movement for TERM=xterm-1003 is not showing (most of
the response lines are blank).  Reading through the changes, it seems that
you might still be assuming that detail about 64 vs 96 is incorrect.  But
I'm testing with xterm in the modes that the wheel mouse and any-event
logic are designed for...

However, the queue-draining aspect is related to the change I'm temporarily
reverting.  So that's an area to explore.

I think that if I can guide you toward setting up the same testcases,
then the integration process will go smoother.  It would also help if
the patch were refactored into several phases, each of which would make
some specific improvement that could be tested.


Yes, I still assume the detail about 64 vs 96 is incorrect.
Note that I did not configure ncurses to handle extended events, just standard ones (./configure --prefix=/usr/local --enable-static --with-gnu-ld --host=i386-pc-linux-gnu --without-ada --with-normal --without-shared --with-gpm --enable-widec --without-dlsym --with-terminfo-dirs=/etc/terminfo:/lib/terminfo:/usr/share/terminfo:/usr/local/share/terminfo --enable-const) (the /usr/local prefix is only to avoid overwriting my default library for tests).

I linked program with the debug version, set NCURSES_TRACE to 641 and see the following traces (filtering them to get only revealing ones):
 - when rolling wheel:
_nc_mouse_init() called
_nc_mouse_inline() called
_nc_mouse_inline sees the following xterm data: '`H.'
_nc_mouse_inline: primitive mouse-event id 0 at (39, 13, 0) state 80000 = {press-4} has slot 0

 - when pressing button 1 and moving mouse:
_nc_mouse_inline() called
_nc_mouse_inline sees the following xterm data: ' =%'
_nc_mouse_inline: primitive mouse-event id 0 at (28, 4, 0) state 2 = {press-1} has slot 1
_nc_mouse_inline() called
_nc_mouse_inline sees the following xterm data: '@=&'
_nc_mouse_inline: primitive mouse-event id 0 at (28, 5, 0) state 8000000 = {position} has slot 2

So the wheel event is 96 (`) and mouse motion is 64 (@) in what I get.

The terminals I tried on are:
 * xterm X.Org 6.7.0(196) (Mandrake 10.1),
* konsole 1.3.2 (Mandrake 10.1) (this one does not support mouse motion but wheel event is 96)
 * gnome terminal 2.28.1 (Ubuntu 9.10),
 * lxterminal (unknown version but copyrighted 2011) (PartedMagic 6.6)

I do not know which tests more I could do or which terminal you use, but it seems there is some implementation difference. I could try using extended event to see if it does some difference.
I will also try the patch you sent to see the result.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]