views:

271

answers:

1

When you hold "shift" and scroll with your mouse on a mac, it interprets your vertical scroll motion into horizontal scroll actions. This is my most missed feature when working on linux, and I would love to bring it to linux (since I have looked thoroughly and nobody else seems to have done so yet).

I hope this can be done with some sort of runtime plugin, or at least in a way that doesn't require me to recompile all my other applications for them to make use of the functionality. My question is: What libraries out there would allow such a plugin to be written? Writing some sort of script would be nice, as it doesn't seem like the functionality should be that complex, but I can code in C and C++ if need be.

I have looked into X solutions like XEvIE (discontinued) and XTrap (similarly abandoned, it seems). I would be happy to restrict myself to GTK / GNOME only for now, at least as a proof of concept.

If this can't be done as a plugin, which open-source project should I approach (Xfree86? GNOME? someone else?) to try and get this functionality into?

-- update (with a solution!):

install the packages "xbindkeys" and "xautomation". Then write the following in your ~/.xbindkeysrc.scm file:

; bind shift + vertical scroll to horizontal scroll events
(xbindkey '(shift "b:4") "xte 'mouseclick 6'")
(xbindkey '(shift "b:5") "xte 'mouseclick 7'")

then just run xbindkeys

+1  A: 

I am not sure but evdev can do things like this. For example it can simulate keyboard presses when a mouse button (scroll up/down is also a button) is pressed. It might be possible to do horizontal scrolling (possibly with keyboard left/right arrows?).

stribika
Thanks! While not exactly the solution, searching for "evdev modifier" led me to a working solution surprisingly quickly.I ended up using xbindkeys (from the package of the same same), and xte (from the xautomation package). All I needed then was the following ~/.xbindkeysrc.scm file:; bind shift + vertical scroll to horizontal scroll events(xbindkey '(shift "b:4") "xte 'mouseclick 6'")(xbindkey '(shift "b:5") "xte 'mouseclick 7'")run xbindkeys, and bob's your sideways-scrolling uncle!Cheers :D
gfxmonk
damn formatting. i'll make an edit to the question :s
gfxmonk