this script uses the capslock key to give a hotkey 2 different outputs.
up::
GetKeyState, capstate, capslock, t
Loop
{
GetKeyState, state, up, P
if state = D
if capstate = d
{
send, e
break
}
else
if capstate = u
{
send, {up}
break
}
}
return
use capslock as a toggle
Started by
jamestr
, Apr 05 2004 04:59 AM
1 reply to this topic
#1
-
Posted 05 April 2004 - 04:59 AM
Using the state of keys to change the actions of others is a good idea. Note: That particular script probably won't work on Windows 9x because retrieving the Capslock state on those OSes is unreliable (as documented).
A related idea is to use Capslock a modifier (though this won't work on Win9x yet):
Capslock & a::MsgBox, You pressed A while holding down Capslock.
When this hotkey is pressed, the state of the Capslock key will not be changed. This allows Capslock to be a true modifier with no side-effects.
Btw, if anyone is wondering how to get the forum to accept indentation, the only way I know is to use the "Code" button to enclose your code and make sure you use hard spaces rather than tabs. I wonder if there's an easier way.
A related idea is to use Capslock a modifier (though this won't work on Win9x yet):
Capslock & a::MsgBox, You pressed A while holding down Capslock.
When this hotkey is pressed, the state of the Capslock key will not be changed. This allows Capslock to be a true modifier with no side-effects.
Btw, if anyone is wondering how to get the forum to accept indentation, the only way I know is to use the "Code" button to enclose your code and make sure you use hard spaces rather than tabs. I wonder if there's an easier way.
#2
-
Posted 05 April 2004 - 11:42 AM