Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there any way to have mouse-wheel events sent to whatever window is underneath the mouse pointer, even if it's not the active window? I'd like to have x-scrollwheel capabilities without having to turn on x-mouse.

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

I'm not sure if this is supported in Windows natively, but a program called KatMouse should do just this:

The prime purpose of the KatMouse utility is to enhance the functionality of mice with a scroll wheel, offering 'universal' scrolling: moving the mouse wheel will scroll the window directly beneath the mouse cursor (not the one with the keyboard focus, which is default on Windows OSes). This is a major increase in the usefullness of the mouse wheel.

KatMouse

share|improve this answer
    
I'm already using KatMouse, but it doesn't always seem to do the trick. –  Chris Charabaruk Oct 14 '09 at 3:24
    
N/M, I'm an idiot who needs to RTFD. Still, it doesn't work for some apps, like Document Explorer. –  Chris Charabaruk Oct 14 '09 at 3:30
    
Autohotkey would make it trivial to send, say, a mouseclick to the down button next to the scrollbar. –  Phoshi Oct 14 '09 at 10:29
    
KatMouse uses proper wheelmouse semantics for windows, and can be configured to do scroll mouseclicks for windows which don't support wheelmouse messages, per-application and per-window. It's a cinch to set up that way, too. KatMouse wins for this purpose. –  Chris Charabaruk Oct 14 '09 at 15:59
add comment

Autohotkey!

CoordMode, Mouse, Screen
SetWinDelay, -1
SetBatchLines,-1
SetKeyDelay, -1

; acceleration
_WHEELACC=0x280000
; max speed
_WHEELMAXN=0x1800000
; automatically activate window
_WHEELAUTOFOCUS=1

return


EasyWheel(d)
; if _WHEELAUTOFOCUS if set, check which window is under the mouse and gives it focus if it hasn't already
; then send scroll event to the control under the mouse
; original code from Shimanov: http://www.autohotkey.com/forum/viewtopic.php?t=6772#54821
{
Global _WHEELACC
   , _WHEELMAXN
   , _WHEELAUTOFOCUS
Static t, s


   if ( A_TickCount > 500+t) {
      t := A_TickCount
      s :=0x780000
   }
   else if (s < _WHEELMAXN)
      s += _WHEELACC

   MouseGetPos x, y, hwnd
   h := DllCall("WindowFromPoint", "int", x, "int", y)
   if _WHEELAUTOFOCUS && (hwnd<>WinExist("A"))
      WinActivate, ahk_id %hwnd%
   SendMessage, 0x20A, d*s,(y<<16)|x,, ahk_id %h%
}


WheelUp:: EasyWheel(1)
WheelDown:: EasyWheel(-1)

(Taken from the thread linked in the script comment)

AHK can do anything :3

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.