Skan wrote:
Dear
Geoff,

Further to your
Private Message I post the following solution:
Code:
DetectHiddenWindows, ON
~CapsLock::
If GetKeyState("CapsLock","T")
Gui, 1:Show, w100 h100 Hide, Ahk.Dummy.Window
Else
Gui, 1:Destroy
Return
#IfWinExist, Ahk.Dummy.Window
a::SendInputU( "0430" )
b::SendInputU( "0431" )
v::SendInputU( "0432" )
g::SendInputU( "0430" )
d::SendInputU( "0434" )
e::SendInputU( "0435" )
z::SendInputU( "0437" )
i::SendInputU( "0438" )
#IfWinExist
Not-so-elegant .. as the GUI will be consuming memory ( 1 MB+ ) when CapsLock is ON.
The following code uses the
ternary operator instead:
Code:
a::CapsON() ? SendInputU( "0430" ) : SendInputU( "0061" )
b::CapsON() ? SendInputU( "0431" ) : SendInputU( "0062" )
v::CapsON() ? SendInputU( "0432" ) : SendInputU( "0076" )
g::CapsON() ? SendInputU( "0430" ) : SendInputU( "0061" )
d::CapsON() ? SendInputU( "0434" ) : SendInputU( "0064" )
e::CapsON() ? SendInputU( "0435" ) : SendInputU( "0065" )
z::CapsON() ? SendInputU( "0437" ) : SendInputU( "007A" )
i::CapsON() ? SendInputU( "0438" ) : SendInputU( "0069" )
CapsON() {
Return GetKeyState("CapsLock", "T")
}
Hope the information is useful.
Regards,

I like the not so elegant solution the best

One problem with it:
This worked just fine in the old version
Code:
d::
If CapsON()
{
SendInputU( "0434" )
}
Else SendInputU( "0064" )
return
:?c*:DD::
If CapsON()
{
SendInputU( "0402" )
}
Else
{
SetKeyDelay, -10
SendInputU( "00640064" )
}
return
Basically, if one D is pressed you get one thing, but if two are pressed it replaces those two with one character. Worked just fine.
BUT, using the hidden GUI method, this fails to work. Any ideas?
Here's the code:
Code:
DetectHiddenWindows, ON
~CapsLock::
If GetKeyState("CapsLock","T")
Gui, 1:Show, w100 h100 Hide, Ahk.Dummy.Window
Else
Gui, 1:Destroy
Return
#IfWinExist, Ahk.Dummy.Window
d::SendInputU( "0434" )
:?c*:DD::SendInputU( "0452" )
[code continues...]