[deleted] Topic is solved
Re: Code won't type letters
Try to understand and learn from it
If you only want to fix your code use Send, {A} Read here : https://autohotkey.com/docs/commands/Send.htm
For all keys (single):
All keys (double):
Only for "a":
If you only want to fix your code use Send, {A} Read here : https://autohotkey.com/docs/commands/Send.htm
For all keys (single):
Code: Select all
#NoEnv
#MaxHotkeysPerInterval 99000000
#HotkeyInterval 99000000
#MaxThreadsPerHotkey 255
#KeyHistory 0
SetWorkingDir %A_ScriptDir%
SendMode Input
lastkeypressed = ""
global lastkeypressed
return
doubleCheck(key)
{
if(key == lastkeypressed)
{
send_key = ""
StringUpper, send_key, key
Send, %send_key%
lastkeypressed = ""
}
else
{
send_key = %key%
if(GetKeyState("Shift", "p"))
{
StringUpper, send_key, key
}
Send, %key%
lastkeypressed = %key%
}
}
$*A::doubleCheck("a")
$*B::doubleCheck("b")
$*C::doubleCheck("c")
$*D::doubleCheck("d")
$*E::doubleCheck("e")
$*F::doubleCheck("f")
$*G::doubleCheck("g")
$*H::doubleCheck("h")
$*I::doubleCheck("i")
$*J::doubleCheck("j")
$*K::doubleCheck("k")
$*L::doubleCheck("l")
$*M::doubleCheck("m")
$*N::doubleCheck("n")
$*O::doubleCheck("o")
$*P::doubleCheck("p")
$*Q::doubleCheck("q")
$*R::doubleCheck("r")
$*S::doubleCheck("s")
$*T::doubleCheck("t")
$*U::doubleCheck("u")
$*V::doubleCheck("v")
$*W::doubleCheck("w")
$*X::doubleCheck("x")
$*Y::doubleCheck("y")
$*Z::doubleCheck("z")
Code: Select all
#NoEnv
#MaxHotkeysPerInterval 99000000
#HotkeyInterval 99000000
#MaxThreadsPerHotkey 255
#KeyHistory 0
SetWorkingDir %A_ScriptDir%
SendMode Input
lastkeypressed = ""
global lastkeypressed
return
doubleCheck(key)
{
if(key == lastkeypressed)
{
send_key = ""
StringUpper, send_key, key
Send, %send_key%
lastkeypressed = ""
}
else
{
send_key = %key%
if(GetKeyState("Shift", "p"))
{
StringUpper, send_key, key
}
Send, %key%
lastkeypressed = %key%
}
}
~$*A::doubleCheck("a")
~$*B::doubleCheck("b")
~$*C::doubleCheck("c")
~$*D::doubleCheck("d")
~$*E::doubleCheck("e")
~$*F::doubleCheck("f")
~$*G::doubleCheck("g")
~$*H::doubleCheck("h")
~$*I::doubleCheck("i")
~$*J::doubleCheck("j")
~$*K::doubleCheck("k")
~$*L::doubleCheck("l")
~$*M::doubleCheck("m")
~$*N::doubleCheck("n")
~$*O::doubleCheck("o")
~$*P::doubleCheck("p")
~$*Q::doubleCheck("q")
~$*R::doubleCheck("r")
~$*S::doubleCheck("s")
~$*T::doubleCheck("t")
~$*U::doubleCheck("u")
~$*V::doubleCheck("v")
~$*W::doubleCheck("w")
~$*X::doubleCheck("x")
~$*Y::doubleCheck("y")
~$*Z::doubleCheck("z")
Code: Select all
#NoEnv
#MaxHotkeysPerInterval 99000000
#HotkeyInterval 99000000
#MaxThreadsPerHotkey 255
#KeyHistory 0
SetWorkingDir %A_ScriptDir%
SendMode Input
lastkeypressed = ""
global lastkeypressed
return
doubleCheck(key)
{
if(key == lastkeypressed)
{
send_key = ""
StringUpper, send_key, key
Send, %send_key%
lastkeypressed = ""
}
else
{
send_key = %key%
if(GetKeyState("Shift", "p"))
{
StringUpper, send_key, key
}
Send, %key%
lastkeypressed = %key%
}
}
~$*A::doubleCheck("a")
Re: Program won't type letters
Try this:
I hope this helps.
Code: Select all
case = 0
a::
if case = 0 ; <<<< here
{
ClipSaved := Clipboard
Clipboard= a
send, ^v ; <<<< here
Clipboard= %ClipSaved%
case = 1
}
else ; <<<< here
{
ClipSaved := Clipboard
Clipboard= A
send, ^v ; <<<< here
Clipboard= %ClipSaved%
case = 0
}
Re: Code won't type letters
Isn't there an AHK equivalent of something like this:
If Asc(s) > 96 Then
s = UCase(s)
Else
s = LCase(s)
End If
If Asc(s) > 96 Then
s = UCase(s)
Else
s = LCase(s)
End If
Re: Code won't type letters
There are more errors in OP script.
First, like Qysh already said, use Send.
Second, a logic error: case=1 will never properly execute, it will at present execute immediately after case=0.
Last: syntax error here: corrected version is if case = 0.
First, like Qysh already said, use Send.
Second, a logic error: case=1 will never properly execute, it will at present execute immediately after case=0.
Last: syntax error here: corrected version is if case = 0.
Code: Select all
case = 0
a::
if case = 0 ; <<<< here
{
ClipSaved := Clipboard
Clipboard= a
send, ^v ; <<<< here
Clipboard= %ClipSaved%
case = 1
}
else ; <<<< here
{
ClipSaved := Clipboard
Clipboard= A
send, ^v ; <<<< here
Clipboard= %ClipSaved%
case = 0
}
Re: Code won't type letters
tRy ThIs. ChEeRs.
Code: Select all
;switch between upper/lower case letters when typing lower case letters
;put at the top the of script (in the auto-execute section)
Loop, 26
Hotkey, % "$" Chr(96+A_Index), SubInvertLetter
return
;q::
;w::
;e::
SubInvertLetter:
vLetter := SubStr(A_ThisHotkey, StrLen(A_ThisHotkey))
vToggle := !vToggle
SendInput, % Format(vToggle ? "{:L}" : "{:U}", vLetter)
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: Code won't type letters
Hallo,
or this:
or this:
Code: Select all
SetStoreCapsLockMode, Off
Loop
{
Input, Key, VL1
If Key is alpha
Send {CapsLock}
}
Who is online
Users browsing this forum: downstairs, filipemb, Google [Bot], OrangeCat and 164 guests