0

Question:

I want to use my scroll wheel to open an inactive window when I scroll up on an icon in the taskbar in Windows 10. The same behavior as in Ubuntu when you scroll up on an icon in the taskbar.

Is there a setting to do this, or program?

Why:

I've been working on a Linux system and am now used to scroll up on a icon in order to open an inactive window. This is has nice feeling for the work flow, I would like to transfer this to Windows 10, but can't find anything that does this. Yes, I know I can just click on it, but sometimes it's nice to just scroll as my finger is already there a lot of the time when working.

Note: I'm not looking for the inactive hover over scroll functionality, that works just fine.

Nytrix
  • 163

2 Answers2

1

You can use AutoHotkey to do this. Basically you tell it that if your cursor is over the taskbar or one of the preview thumbnails that opens from it, then scrolling up with your mouse wheel sends a left click, otherwise it scrolls up.

This requires using the Windows API. I've tested this script and it seems to work like you want, though I believe it will send a click anywhere on the taskbar, and not just over window icons. I'm afraid that's the best I could manage.

GetWinUnderMouse(what="Title")
{
    ; Allocate the memory (8 bytes) for the POINT structure
    VarSetCapacity(POINT, 8, 0)

    ; Call the GetCursorPos function with the address 
    ; of the POINT structure we just created
    DllCall("GetCursorPos", uint, &POINT)

    ; Use NumGet to get the information out of the structure
    ; the x-value is stored in the first 4 bytes, and 
    ; the y-value in the last 4
    X := NumGet(POINT, 0)
    Y := NumGet(POINT, 4)

    return GetWinAtCoords(X, Y, what)
}

GetWinAtCoords(x,y,what="Title")      ; by SKAN and Learning one
{
    ; Returns Title/ID/Class/PID of window at given coordinates
    WinID := DllCall( "GetAncestor", UInt      ; by SKAN
           ,DllCall( "WindowFromPoint", Int,X, Int,Y )
           , UInt, GA_ROOT := 2)
    if what = Title
    {
        WinGetTitle, WinTitle, ahk_id %WinID%
        Return WinTitle
    }
    else if what = ID
    Return WinID
    else if what = Class
    {
        WinGetClass, WinClass, ahk_id %WinID%
        Return WinClass
    }
    else if what = PID
    {
        WinGet, WinPID, PID, ahk_id %WinID%
        Return WinPID
    }
}

WheelUp::
    PointedClass := GetWinUnderMouse("Class")
    if (PointedClass = "TaskListThumbnailWnd" or PointedClass = "Shell_TrayWnd")
    {
        Send, {LButton}
    }
    else
    {
        Send, {WheelUp}
    }
Return

If you add a tilde (~) before WheelUp:: then the wheel up functionality will remain even when a left click is sent (you can also do away with the else clause in there if you do so).

To use, simply install the program, put the script in a file and run it.

0

You could use some programs such as AlwaysMouseWheel, X-Button Mouse Control! On Windows 7, is there any way to make the scrollwheel's focus follow the mouse?

daidai
  • 377
  • 1
  • 4