AHK randomly pressing Ctrl while scrolling

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
lepel
Posts: 3
Joined: 23 Feb 2019, 15:59

AHK randomly pressing Ctrl while scrolling

23 Feb 2019, 16:03

I set up a shortcut so I can hold Alt and scroll up or down to adjust my volume. This works fine, however AHK seems to sometimes press Ctrl, because when I use it while Chrome or Windows Explorer is in focus it will zoom the page/icons every so often. If I just hold Alt and continuously scroll up and down it'll zoom in or out every few seconds.

Script:

Code: Select all

!WheelUp::Send {Volume_Up 2}
!WheelDown::Send {Volume_Down 2}
Any ideas why this is happening, or is it a bug? Using AHK v1.1.30.01 which is the latest as far as I can tell.

Also posted here: https://superuser.com/questions/1408867/autohotkey-triggers-ctrl-while-scrolling
gregster
Posts: 9020
Joined: 30 Sep 2013, 06:48

Re: AHK randomly pressing Ctrl while scrolling

23 Feb 2019, 16:50

Ctrl is the #MenuMaskKey for Alt (and also the windows key).

You can change it. Try #MenuMaskKey vk07 at the top if your script...
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: AHK randomly pressing Ctrl while scrolling

23 Feb 2019, 16:52

Code: Select all

!WheelUp::Send {Blind}{Volume_Up 2}
!WheelDown::Send {Blind}{Volume_Down 2}
should suppress it too

ah yes, the exact reason why eluded me, but gregster appears to have already posted it
i wonder, though, why was CTRL chosen as the default masking key, and not vk07
gregster
Posts: 9020
Joined: 30 Sep 2013, 06:48

Re: AHK randomly pressing Ctrl while scrolling

23 Feb 2019, 17:09

It seems, Chris had some reservations about the potential side-effects of virtual key codes, back in 2007:
https://autohotkey.com/board/topic/20619-extraneous-control-key-presses-generated-by-or-hotkeys/?p=135844 wrote:Sending the 0xFF virtual key instead of VK_CONTROL has a significant risk of breaking existing scripts, especially games and other apps that might recognize and respond to any non-modifier keystroke (even 0xFF). In fact, some apps might recognize and respond only to scan codes (ignoring the virtual keys). In such cases, if the low-order byte of the scan code matches that of any other key on any keyboard layout/language, it would probably produce unwanted characters for some users.
Lexikos then introduced #MenuMaskKey in 2009 to AHK_L...
lepel
Posts: 3
Joined: 23 Feb 2019, 15:59

Re: AHK randomly pressing Ctrl while scrolling

24 Feb 2019, 06:59

Spent a day trying to figure out why this forum would just time out any time I tried to reply. Turns out new members can't use quotes, without telling new members you can't use quotes. Guess I'll have to make my own quotes.

gregster:
---
Ctrl is the #MenuMaskKey for Alt (and also the windows key).

You can change it. Try #MenuMaskKey vk07 at the top if your script...

---

Tried this, and while it fixed the zooming, I suddenly started getting a million overlays from Windows asking me if this application was a game and if I wanted to open the gamebar. Chrome froze for a few seconds until I was able to close all the overlays.

swagfag:
---

Code: Select all

!WheelUp::Send {Blind}{Volume_Up 2}
!WheelDown::Send {Blind}{Volume_Down 2}
should suppress it too

ah yes, the exact reason why eluded me, but gregster appears to have already posted it
i wonder, though, why was CTRL chosen as the default masking key, and not vk07

---

This fixed it for me, now nothing happens aside of the expected behavior. Thank you!
gregster
Posts: 9020
Joined: 30 Sep 2013, 06:48

Re: AHK randomly pressing Ctrl while scrolling

24 Feb 2019, 12:56

Good to know, thanks for the feedback.

Concerning the quoting problem: Sorry, there were massive spam attacks recently on the forum which abused the quoting mechanism.
There are now a lot of new rules that still get fine-tuned - and yes, information on this might not always be up-to-date.
lepel
Posts: 3
Joined: 23 Feb 2019, 15:59

Re: AHK randomly pressing Ctrl while scrolling

25 Feb 2019, 12:55

All good, but it's weird that there's no message telling new users that they can't use quotes. After submitting the page would load for a minute, then Chrome would tell me the website couldn't process my request. I'm a webdev myself so I assumed that there was some server issue or phpBB bug. Once I even got a php error about the spamfilter, but because I didn't get any other messages I didn't think much of it. Surely there must be some phpBB plugins that can show proper error messages when certain BB codes are found? Quoting is one of the most normal things to do on a forum, I could very likely see less tech savvy people just giving up and never bothering to follow up on their questions, which would be a shame for others who have the same issues in the future.

Anyway, enough of my rambling, I'm happy the issue if fixed! I added your answers to my superuser.com question so that others can easily find the solution in the future.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: filipemb, mikeyww and 263 guests