Page 1 of 1

Troubles on Windows 10

Posted: 19 May 2017, 16:18
by autohotkeytester
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.

Re: Troubles on Windows 10

Posted: 22 May 2017, 17:20
by autohotkeytester
Any ideas or suggestions?

Re: Troubles on Windows 10

Posted: 23 May 2017, 03:42
by WalkerOfTheDay
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 ?

Re: Troubles on Windows 10

Posted: 23 May 2017, 17:46
by autohotkeytester
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

Re: Troubles on Windows 10

Posted: 23 May 2017, 19:47
by autohotkeytester
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.

Re: Troubles on Windows 10

Posted: 24 May 2017, 06:48
by DyaTactic
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.

Re: Troubles on Windows 10

Posted: 07 Jun 2017, 16:32
by autohotkeytester
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).

Re: Troubles on Windows 10

Posted: 14 Jun 2017, 11:09
by DyaTactic
Here is my reply. Better late then never. Hope this makes thing clear.

Code: Select all

>^#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

Re: Troubles on Windows 10

Posted: 14 Jun 2017, 17:56
by autohotkeytester
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

Re: Troubles on Windows 10

Posted: 15 Jun 2017, 03:01
by DyaTactic
Almost

Code: Select all

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

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.

Re: Troubles on Windows 10

Posted: 15 Jun 2017, 10:58
by autohotkeytester
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

Re: Troubles on Windows 10

Posted: 15 Jun 2017, 11:13
by DyaTactic
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.

Re: Troubles on Windows 10

Posted: 07 Jul 2017, 12:19
by autohotkeytester
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

Re: Troubles on Windows 10

Posted: 07 Jul 2017, 12:35
by DyaTactic
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.

Re: Troubles on Windows 10

Posted: 08 Jul 2017, 13:17
by RickC
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...