Troubles on Windows 10

Get help with using AutoHotkey and its commands and hotkeys
autohotkeytester
Posts: 8
Joined: 19 May 2017, 16:08

Troubles on Windows 10

19 May 2017, 16:18

Has anyone had troubles with AutoHotKey on Windows 10?

I have an AutoHotKey .exe I have used for years on Windows 7 with no problems.

When I first start it on Windows 10, it works fine but about 30 minutes later the functions are being executed when I haven’t called the shortcut commands.

For example:
I have one that types my email address which is triggered by Windows Key + e
When I am typing a word that contains the letter e, the function will start writing my email even though I didn’t press the Windows key.
autohotkeytester
Posts: 8
Joined: 19 May 2017, 16:08

Re: Troubles on Windows 10

22 May 2017, 17:20

Any ideas or suggestions?
WalkerOfTheDay
Posts: 257
Joined: 24 Mar 2016, 03:01

Re: Troubles on Windows 10

23 May 2017, 03:42

Looks like a 'stuck' Windows key. I sometimes get this too, but not only in Windows 10.
I don't even think it's AHK related. A lot of people have this. Just google 'Stuck windows key' and you'll get
loads of hits.

I just ram the Windows key a couple of times and it goes away. What happens when you press other
keys that don't have a hotkey assigned, for instance the R key ?

Does it open the 'Run' box ?
autohotkeytester
Posts: 8
Joined: 19 May 2017, 16:08

Re: Troubles on Windows 10

23 May 2017, 17:46

I just shook and blew out my keyboard, there was a little bit of dust. We will see if it continues to happen and if it does I will try another letter I have a different shortcut set on. Thanks
autohotkeytester
Posts: 8
Joined: 19 May 2017, 16:08

Re: Troubles on Windows 10

23 May 2017, 19:47

It occurred again, this time I didn't have the USB keyboard attached, I was using the MS Surface Book attached keyboard.

It didn't bring up the run box and pressing the other shortcut letters didn't run the functions.
User avatar
DyaTactic
Posts: 160
Joined: 04 Apr 2017, 05:52

Re: Troubles on Windows 10

24 May 2017, 06:48

I had this problem with my "Win + Ctrl + L = Standby" hotkey. My idea was that Autohotkey misses the Win (or Ctrl) Down event when the key is released while the PC is going in Standby. After waking up Autohotkey still thinks the key is down.
I fixed this with a KeyWait, Ctrl command. This way the hotkey is only fired after Autohotkey sees the 'down event'.

Let me know if this helps.
autohotkeytester
Posts: 8
Joined: 19 May 2017, 16:08

Re: Troubles on Windows 10

07 Jun 2017, 16:32

DyaTactic, would you please post an example of how you use the KeyWait Ctrl command? I was looking at help and I can get it to work with a single key, but I am having troubles with getting it to work with two keys (Windows Key + e).
User avatar
DyaTactic
Posts: 160
Joined: 04 Apr 2017, 05:52

Re: Troubles on Windows 10

14 Jun 2017, 11:09

Here is my reply. Better late then never. Hope this makes thing clear.

Code: [Select all] [Download] GeSHi © Codebox Plus

>^#l::	; Win Lock & Sleep.
KeyWait RCtrl ; If there is no delay Autohotkey misses the {Ctrl Up} event, due to the locked pc?. So after logging in again, pressing #L will trigger this hotkey (and other ^ hotkeys) because of it.

DllCall("LockWorkStation") ; Lock pc.
SLEEP 1000
DllCall("PowrProf\SetSuspendState", "int", 0, "int", 0, "int", 0) ; Put pc in Standby.
Return
autohotkeytester
Posts: 8
Joined: 19 May 2017, 16:08

Re: Troubles on Windows 10

14 Jun 2017, 17:56

So if my script looks like this:
LAlt & e::
send {m}{y}{e}{m}{a}{i}{l}{@}{t}{e}{s}{t}{.}{c}{o}{m}
return

Do I change it to this?
KeyWait LAlt

LAlt & e::
send {m}{y}{e}{m}{a}{i}{l}{@}{t}{e}{s}{t}{.}{c}{o}{m}
return
User avatar
DyaTactic
Posts: 160
Joined: 04 Apr 2017, 05:52

Re: Troubles on Windows 10

15 Jun 2017, 03:01

Almost

Code: [Select all] [Download] GeSHi © Codebox Plus

LAlt & e::
KeyWait LAlt
send {m}{y}{e}{m}{a}{i}{l}{@}{t}{e}{s}{t}{.}{c}{o}{m}
return

But your code does not give any problems on my pc.
Is there a reason you put all the chracters in brackets?
This code works too:

Code: [Select all] [Download] GeSHi © Codebox Plus

LAlt & e::
Send myemail@test.com
Return

I think the stuck Win key is caused by another hotkey, assuming it is caused by Autohotkey. Though it is worth trying the KeyWait command.

Let me know how it worked.
autohotkeytester
Posts: 8
Joined: 19 May 2017, 16:08

Re: Troubles on Windows 10

15 Jun 2017, 10:58

I put the brackets because that was how I saw other people were doing multiple non-alpha keys to make a shortcut, it matters for special characters. Without the brackets the alpha characters work fine, but the special characters won't be sent.

So the KeyWait only needs to be in the job a single time correct? If I have multiple short cuts which use the windows key and the alt keys I can do this only at the top of the job?

KeyWait #
KeyWait RAlt
KeyWait LAlt
User avatar
DyaTactic
Posts: 160
Joined: 04 Apr 2017, 05:52

Re: Troubles on Windows 10

15 Jun 2017, 11:13

When sending certain keystrokes the brackes are essential. The !, ^, # for example need to be placed in brackets otherwise the Alt, Ctrl or Win key will be pressed. Also keys called by name like {Enter} and {Backspace} also require brackets.

Indeed the KeyWait command should be put direcly after defining the shortcut (i.e. under the ‘LAlt & e::’ line). If you dont know what hotkey is causing the stuck key you can add this line under each shortcut.
autohotkeytester
Posts: 8
Joined: 19 May 2017, 16:08

Re: Troubles on Windows 10

07 Jul 2017, 12:19

This is still giving me troubles. I removed everything in the script except the one function and the issue still occurs :( With AutoHot key case of words doesn't matter correct?
For example, send vs Send or return vs Return.

LAlt & e::
KeyWait LAlt
send {m}{y}{e}{m}{a}{i}{l}{@}{t}{e}{s}{t}{.}{c}{o}{m}
return
User avatar
DyaTactic
Posts: 160
Joined: 04 Apr 2017, 05:52

Re: Troubles on Windows 10

07 Jul 2017, 12:35

I can't help you further. I have no clue what is causing this. I'm sorry.

Hope you or someone els on this forum can find something.
RickC
Posts: 140
Joined: 27 Oct 2013, 08:32

Re: Troubles on Windows 10

08 Jul 2017, 13:17

Work around it by using a hotstring replacement instead of using the Windows key?

I use the following so every time I type the @ sign twice, AHK automatically replaces the 2 @ signs with my email address.

:*:@@::myemail@test.com

Hope this helps...

Return to “Ask For Help”

Who is online

Users browsing this forum: A_AhkUser, Bing [Bot], Exaskryz, Exequiel3k, KrycerKris, Mateus Campello, MaxAstro, Yahoo [Bot] and 38 guests