Is this a bug? the same script worked fine in Windows 10

Report problems with documented functionality
diego_cl
Posts: 11
Joined: 24 Nov 2023, 07:10

Is this a bug? the same script worked fine in Windows 10

Post by diego_cl » 05 Dec 2024, 14:03

I've been using the same script for a year in Windows 10.

After updating to Windows 11, the scroll wheel doesn't scroll upwards after some random usage. It works while ALT key is pressed (ALT functions as a modifier to boost the scrolling speed).

Is this a bug that only occurs when running Autohotkey on Windows 11?


This is my script:

Code: Select all

#Requires AutoHotkey v2.0
speed := 5

MButton::MButton
MButton & WheelUp::  WheelLeft
MButton & WheelDown::WheelRight

LAlt::LAlt
LAlt & WheelUp::  Send '{WheelUp '   speed '}'
LAlt & WheelDown::Send '{WheelDown ' speed '}'

 ;RAlt::RAlt
 ;~RAlt & ñ::Send "hola"

#F1::Run "website.com"
#F2::Run "website.com"
#F3::Run "website.com"
#F4::Run "website.com"
#F6::Run "website.com"
#F7::Run "website.com"
#F8::Run "website.com"
#F9::Run "website.com"

#HotIf MouseIsAtTopOfTheScreen()
WheelUp::  Send '^{PgUp}'
WheelDown::Send '^{PgDn}'

MouseIsAtTopOfTheScreen() {  
   MouseGetPos &x, &y
   return y < 35 && x > 0 && x < A_ScreenWidth - 300
}
Last edited by Ragnar on 05 Dec 2024, 14:13, edited 1 time in total.
Reason: code tags

280
Posts: 10
Joined: 05 Dec 2021, 21:59

Re: Is this a bug? the same script worked fine in Windows 10

Post by 280 » 10 Dec 2024, 00:14

Was just coming here to report a similar bug, seems scroll wheel as the second argument in a combination is not correctly handled and causes inconsistent actions.
In my case I needed a script to change the volume when holding a key and scrolling, and it would always block scrolling.
I am also using Windows 11 so you may be correct about that being the issue, however I believe I had gotten a similar script to work previously on a Windows 11 machine without a hacky workaround (the workaround I used, proposed by user Draken was to add

Code: Select all

WheelUp::WheelUp
WheelDown::WheelDown
which works to allow the scroll wheel to work on its own, but not when using a modifier.)

diego_cl
Posts: 11
Joined: 24 Nov 2023, 07:10

Re: Is this a bug? the same script worked fine in Windows 10

Post by diego_cl » 16 Dec 2024, 15:45

Thanks! I think I was able to fix my script using your workaround

280
Posts: 10
Joined: 05 Dec 2021, 21:59

Re: Is this a bug? the same script worked fine in Windows 10

Post by 280 » 28 Dec 2024, 18:58

Updated code since the workaround doesn't properly work for hotkey scrolls (ctrl/alt/shift + scroll)

Code: Select all

#Requires AutoHotkey v2.0
#SingleInstance

A_HotkeyInterval := 20
A_MaxHotkeysPerInterval := 200

~WheelUp::return
~WheelDown::return
Shift & WheelUp::send "+{WheelUp}"
Shift & WheelDown::send "+{WheelDown}"
Ctrl & WheelUp::send "^{WheelUp}"
Ctrl & WheelDown::send "^{WheelDown}"
Alt & WheelUp::send "!{WheelUp}"
Alt & WheelDown::send "!{WheelDown}"

F24 & WheelUp::Volume_Up
F24 & WheelDown::Volume_Down

Post Reply

Return to “Bug Reports”