# gpm and mouse wheel

## mixmasta

Anyone have any information on whether gpm can be used with the mouse wheel to scroll, in the console?  The middle button works fine, but there is no response to scrolling.  

Just so it is clear, I am not asking anything about X windows, that works fine for me.

It's not a big deal, but would be nice, and google isn't helping at all.Last edited by mixmasta on Mon Aug 08, 2005 11:59 pm; edited 2 times in total

----------

## limn

Yes, that would be nice. Think of the wheel as a 'special' purpose. 

Were you aware you can use Shift-Page Up and Shift-Page Down in the console buffer?

----------

## mixmasta

Yes, I know about the scroll buffer.  Actually I'd like to be able to scroll in gpm aware console apps like my tvision based editor.   It already scrolls in X.  

Maybe writing a more/less type pager that uses the scroll wheel would be cool too.  :Wink: 

----------

## flaco

Can you explain to me how to enable the mouse wheel?  I boot to Fluxbox.  The mouse itself works fine left, right, and middle click but the scroll feature is nonfunctional.

Logitech MX-310 USB

----------

## mixmasta

http://colas.nahaboo.net/mouse-wheel-scroll/#xserver

----------

## mixmasta

Oh, and I just remembered links!!!

It would be wonderful to be able to use the scroll wheel with links, the text mode webbrowser.

----------

## balrog

Hi there,

I thought exactly the same and made a gpm patch for this. It has been applied in the gpm-1.20.1-r5 ebuild which is not yet marked stable on any arch so to get it working you need to update ebuilds tree and either unmask it:

# emerge --sync

# ACCEPT_KEYWORDS="~x86" emerge gpm

that is if you use an x86. The other possibility is to wait until it is marked stable and then simply reemerge it:

# emerge gpm

What it does is emit up and down arrow keys to the current tty when you scroll the mouse (ofcourse only if the application doesn't have it's own mouse support, like mc does). To scroll the console with the wheel (like you do with Shift+PgUP and Shift+PgDown) would be too complicated to implement since as you may have noted the buffer is forgotten when you switch to a different tty, and also the Shift+PgUp and Shift+PgDown keys are not passed to the tty, but interpreted directly by the kernel (you can see that because Shift+PgUp and Down keys are not caught even by ncurses apps like links or mc).

Greetings

----------

## mixmasta

Wonderful...  I will try it tonight.  I won't be online for few days so I will report my progress then.  

Cheers!

----------

## mixmasta

Oops,

The ebuild is demanding I emerge several packages xemacs related ...   which I don't wanna do, I'm low on disk space.  How can I get it without xemacs?

Investigating......

----------

## balrog

Try adding USE="-emacs" before the emerge command. I don't know why there is this dependency but i have it too, and i don't have emacs installed.

----------

## dundas

interesting, 

I tried to emerge the masked gpm, and the page up and down is not working, as I scroll my ouse, the only thing is that the commands input history is scrolling, pretty much like using up and down.

any ideas how to let it work as expected?i.e. console history shift+pageup and pagedown

thx

----------

## mixmasta

Ok, I got it installed without xemacs... strange.  After I disconnected from the net I tried the same command, and this time it didnt need xemacs like before.  I don´t know what happened.   :Confused: 

Anyway, back to the patch...  I tried the new ebuild and it works great with my pager (more, less, I use most), and command history (kinda funny that).  

However, as balrog says it doesn´t work on any mouse aware apps, or the kernel video-mem history.   That´s a shame.

Any chance of getting mouse wheel support into gpm itself, and possibly getting the support included in the various applications?  If this could get into gpm, I´ll start writing bugs against all the various console apps and toolkits, etc. to get it included.   :Wink: 

Thanks again.

----------

## EzInKy

 *mixmasta wrote:*   

> 
> 
> Anyway, back to the patch...  I tried the new ebuild and it works great with my pager (more, less, I use most), and command history (kinda funny that).  
> 
> 

 

Thanks for mentioning most, I just emerged it and it definitely a "most excellent pager" B-)

----------

## balrog

Well, gpm itself already has a basic support for the wheels, i.e it tracks their positions. It only doesn't have any visible effect.

I don't know if the information about the state of the wheels is made availiable to the gpm-clients (the apps that have mouse support, like MC or links), but it seems so because in elinks (the improved links browser) I can use both the wheel and clicks. ... Hmm, now that I checked, it also works in MC  :Surprised:  . Now I can't tell if this is a result of the patch or it was there, would have to reemerge gpm-1.20.1-r4. One of these days I'm gonna look into it.

Personally I think scrolling the kernel video-mem history (like when you press Shitft+PgUp/Down) with the mouse wouldn't really be that handy. I use up and down arrows much more frequently than Shift+PgUp/Down, but it depends on what you do.

Greetings

BTW: I just emerged most too and it definitely is nice. VIM is also great as a pager.

----------

