Royi Namir
Royi Namir

Reputation: 148664

Custom combination disables the native function of a key

I don't have the Right WIN key on my keyboard :

enter image description here

So I can't lock the computer with my right hand with right WIN+L

So I created this script :

#NoTrayIcon
AppsKey & L:: DllCall("LockWorkStation")
Return

Which locks the station via : Appskey + L instead.
It does work and the station is being locked.
But I've found out that the Appskey (alone) doesn't work anymore.

Question

What is wrong with my script and how can I fix it ?

Upvotes: 1

Views: 88

Answers (1)

2501
2501

Reputation: 25753

Add the following line anywhere (it must be on its own line) in the code:

AppsKey::AppsKey

This happens because when defining custom combinations, the first key becomes the prefix key and loses its original function. In your example the prefix key was AppsKey.

Upvotes: 1

Related Questions