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

Re: mouse and gpm



On Tue, Mar 24, 2009 at 12:50:17PM +0100, Chris Bannister wrote:
> On Sun, Mar 22, 2009 at 07:42:44PM +1100, Daniel Dalton wrote:
> > Hi,
> > 
> > I'm using a mouse with gpm and brltty, and it is working well... Is it
> > possible to get the scroll wheel on my mouse to scroll the terminal in
> > text mode? eg. work like the page up and page down keys, maybe not as
> > bigger chunks though... Thought it could be cool to scroll emacs buffers
> > and the like with a mouse under text mode?
> > 
> > Is this possible with gpm?
> 
> I think the next/new ncurses will allow this sort of thing. Maybe Thomas
> Dickey has more info. He seems to magically pop in if xterm or lynx is
> mentioned in a post. :)

google (though as time passes, it's more and more spotty in its coverage)

I hadn't really thought about gpm in particular, but wheel mice are
doable with the extension I added a few years ago, and have tested in
xterm (which is a binary change).

That part is something that Daniel Baumann is steering toward
in ncurses updates.

For gpm specifically - that would still require some change (but doesn't
require a whole new version of ncurses).  Someone a few months ago
stated that there's some patch (or configuration) where gpm would
deliver button 4/5 events sort of like xterm, but looking at the gpm.h
header, the only comments regarding wheel mice say it's not clear:

/*....................................... Cfg buttons */
/* Each button has one bit in the 16 bit buttons field. 
 * Mouse movement and wheel movement are not associated with a button 
 * i.e. buttons=GPM_B_NONE in these cases 
 * (except for ms3 mouse, for reasons unknown?) 
 * The middle button if pressed down (or clicked) is independent of  
 *  the wheel "device" which it happens to be associated with 
 * The use of GPM_B_UP/DOWN with ms3 is unclear. Maybe the wheel  
 * could be rolled forward then backward 
 * and this would generate a 'click' event on 'button 5' GPM_B_UP, 
 * but really the expected behaviour of wheel is movement, typically 
 * used for jump scrolling or for jumping between fields on a form. */

#define GPM_B_DOWN      32
#define GPM_B_UP        16
#define GPM_B_FOURTH    8
#define GPM_B_LEFT      4
#define GPM_B_MIDDLE    2
#define GPM_B_RIGHT     1
#define GPM_B_NONE      0

(since gpm's documentation is its source code...)

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net

Attachment: pgps9ZEoq20hI.pgp
Description: PGP signature


Reply to: