Simple hotkey not working when went to Win10, but only for Chrome??

Get help with using AutoHotkey and its commands and hotkeys
Mike_Fay
Posts: 3
Joined: 17 Nov 2019, 13:38

Simple hotkey not working when went to Win10, but only for Chrome??

17 Nov 2019, 13:50

Hi everyone,

I moved from Win7 to Win10 a few days ago. Mostly AHK still works fine, except for one simple hotkey that emulates Control-F4 using my PC's numpad Insert / 0 key:

Code: Select all

NumpadIns::
Sleep, 250
Send, ^{F4}
return
Numpad0::
Sleep, 250
Send, ^{F4}
return
(I did both keys so it doesn't matter if NumLock is on or off.)

My problem is that Chrome is the only thing this hotkey doesn't work in. The hotkey works fine (closes the active window) for TextPad and Word, now that I'm in Win10. How weird!

After some googling, I tried putting in Sleep commands (as you see). I never needed them before. But, no joy. (I should remove them, I guess.)

Another thing that I did was to run the program as Administrator, by editing the Compatibility tab for the EXE. But also no joy.

Can anyone help? This is pretty annoying ... I blow through tons of web pages and only have to lower the thumb of my "mouse hand" to close them with Numpad 0. A.k.a. "Thank You, AutoHotKey".
Last edited by Mike_Fay on 18 Nov 2019, 04:20, edited 1 time in total.
trust_me
Posts: 83
Joined: 29 Jul 2017, 10:46

Re: Simple hotkey not working when went to Win10, but only for Chrome??

18 Nov 2019, 03:53

Your code works for me (win10 ahk 32)

You could try winclose instead:

Code: Select all

NumpadIns::
Sleep, 250
winclose , A
return
Numpad0::
Sleep, 250
winclose , A
return
Mike_Fay
Posts: 3
Joined: 17 Nov 2019, 13:38

Re: Simple hotkey not working when went to Win10, but only for Chrome??

18 Nov 2019, 13:54

Hi,

Thanks so much for suggesting WinClose! I wasn't aware of it.

Alas ... no joy.

It acts just like my ^{F4} ... it will close TextPad and Word windows, but not Chrome tabs. :headwall:
Clone54
Posts: 5
Joined: 15 Nov 2019, 11:08

Re: Simple hotkey not working when went to Win10, but only for Chrome??

18 Nov 2019, 15:45

CTRL+W is also a shortcut to close the chrome tab. Does that one work? Set up a condition to fire CTRL+F4 or CTRL+W depending on what window it is but it sounds like chrome is your main program.
Mike_Fay
Posts: 3
Joined: 17 Nov 2019, 13:38

Re: Simple hotkey not working when went to Win10, but only for Chrome??

18 Nov 2019, 17:34

I did not know about ^W ... alas, while it does close a tab in Chrome without AHK, it still didn't work via AHK bound to my Insert key ... sigh.

That's the bad news. The good news is, this got me to thinking ... I tried binding ^F4 to something not on my numpad (^I) and voila, it works! It closes the current tab in Chrome.

So the good news is, apparently I've found that the problem has something to do with the numpad, although I still don't understand why it works for other programs - and worked in Win7 - just not for Chrome in Win10.

I will fiddle with this ... ultimately maybe find an alternate. But one of the points of simply using numpad Insert is that I didn't have to use a two-handed key combo to close a Chrome tab, sigh ... ordinarily I hardly ever use the numpad (and simply suspend AHK if I do need it). So it was pretty convenient.

Does the idea that it's a numpad keypress that Chrome doesn't like, ring a bell for anyone? (in Win10 but not Win7, fwiw)

Return to “Ask For Help”

Who is online

Users browsing this forum: dentopolis, euras, Google [Bot], RubbeH, Xtra and 70 guests