Search code examples
autohotkeymouse

WheelDown also sends WheelUp


My mouse wheel is busted so i made a ahk script to simulate using my mousewheel. I also added a keystroke output for troubleshooting purposes.

This has revealed to me that Wheeldown also sends Wheelup. Any idea what could cause this to happen and how to fix it?

Loaded script:

enter image description here

result:

https://i.imgur.com/FLqotHG.png

Thanks in advance!


Solution

  • That script of yours doesn't reveal anything about the wheel of your mouse. Without a return at the end of a hotkey subroutine the script jumps to the next line and executes the next hotkey subroutine.

    Try this

    #NoEnv
    #SingleInstance Force
    #InstallKeybdHook
    #InstallMouseHook
    
    WheelDown::KeyHistory
    WheelUp::KeyHistory
    

    KeyHistory displays the most recent keyboard and mouse button events. This way you can see whether the mouse wheel is malfunctioning.