Error The hotkey "e" will not be active because it does not exists in the current keyboard layout
Error The hotkey "e" will not be active because it does not exists in the current keyboard layout
From my old Windows 7 computer I have copy/pasted AutoHotkey commands and when I start AutoHotkey it reports errors:
Note: Error The hotkey "e" will not be active because it does not exists in the current keyboard layout.
On top is error message and behind is AutoHotkey script.
The problem is letter "e" does not exists on my keyboard. This is actually ANSII character that in Windows 1250 code page is character "č" that exits on my keyboard.
This got to be some code page problems. How to fix this code page problems?
Thanks
Note: Error The hotkey "e" will not be active because it does not exists in the current keyboard layout.
On top is error message and behind is AutoHotkey script.
The problem is letter "e" does not exists on my keyboard. This is actually ANSII character that in Windows 1250 code page is character "č" that exits on my keyboard.
This got to be some code page problems. How to fix this code page problems?
Thanks
Re: Error The hotkey "e" will not be active because it does not exists in the current keyboard layout
Hi,
I have got SC027 as scan code. But now my script does not work as intended.
What I would like to do? In "Vim" text editor I would like to completely ignore <Caps Lock> key. E.g. if <Caps Lock> is turned on and I press letter "a" normally I would get letter "A", but I want to get letter "a", so ignoring the <Caps Lock> key.
I have had the following code on my Windows 7 machine (sorry I don't remember the AutoHotKey version).
I have commented out the line 9 with text "č::" to get ";č::" and now added line 8 above with text "SC027::", but now when I press letter "č" in Vim text editor, I get text: sc027, but obviously I want to have "č" letter displayed in text editor.
Any idea how to fix a problem?
Thanks
I have got SC027 as scan code. But now my script does not work as intended.
What I would like to do? In "Vim" text editor I would like to completely ignore <Caps Lock> key. E.g. if <Caps Lock> is turned on and I press letter "a" normally I would get letter "A", but I want to get letter "a", so ignoring the <Caps Lock> key.
I have had the following code on my Windows 7 machine (sorry I don't remember the AutoHotKey version).
Code: Select all
#IfWinActive ahk_class Vim
a::
+a::
b::
+b::
c::
+c::
SC027::
;č::
;+č::
;ć::
;+ć::
d::
+d::
;đ::
;+đ::
e::
+e::
f::
+f::
g::
+g::
h::
+h::
i::
+i::
j::
+j::
k::
+k::
l::
+l::
m::
+m::
n::
+n::
o::
+o::
p::
+p::
q::
+q::
r::
+r::
s::
+s::
;š::
;+š::
t::
+t::
u::
+u::
v::
+v::
w::
+w::
x::
+x::
y::
+y::
z::
+z::
;ž::
;+ž::
varShift := GetKeyState("Shift")
varKeyAll := A_ThisHotkey
StringReplace, varKey, varKeyAll, +
StringUpper, varKeyUpper, varKey
StringLower, varKeyLower, varKey
if varShift = 1
{
Send %varKeyUpper%
}
else
{
Send %varKeyLower%
}
return
#IfWinActive
Any idea how to fix a problem?
Thanks
Re: Error The hotkey "e" will not be active because it does not exists in the current keyboard layout
A demonstration is below.
Code: Select all
key = a
Send %key% {%key%}`n
key = SC027
Send %key% {%key%}`n
Re: Error The hotkey "e" will not be active because it does not exists in the current keyboard layout
From my code in line 8 I have changed:
SC027::
to
SC027:: Send {SC027}
I reloaded the script and now letter "č" works fine in both cases, CapsLocks turned on and CapsLocks turned off.
But strange problem appeared, when I type:
abcčdefghijklmnoprstuvz
it is displayed in both cases CapsLock turned on or off:
ččččdefghijklmnoprstuvz
For some reason letters a, b, c, č and d all get changed to "č". I like the "č" getting into "č", but not a, b, c and d. It is interesting that all other keys are working properly.
Any idea what is the problem?
Regards
SC027::
to
SC027:: Send {SC027}
I reloaded the script and now letter "č" works fine in both cases, CapsLocks turned on and CapsLocks turned off.
But strange problem appeared, when I type:
abcčdefghijklmnoprstuvz
it is displayed in both cases CapsLock turned on or off:
ččččdefghijklmnoprstuvz
For some reason letters a, b, c, č and d all get changed to "č". I like the "č" getting into "č", but not a, b, c and d. It is interesting that all other keys are working properly.
Any idea what is the problem?
Regards
Re: Error The hotkey "e" will not be active because it does not exists in the current keyboard layout
You introduced an implicit Return.
Another example is below.
Introduction and Simple Examples:
Or:
Another example is below.
Code: Select all
#UseHook
a::
+a::
SC027::
Send % Format("{{:" (Instr(A_ThisHotkey, "+") ? "U" : "L") "}}", RegExReplace(A_ThisHotkey, "\W"))
Return
#UseHook Off
Simpler:If a hotkey needs to execute only a single line, that line can be listed to the right of the double-colon. In other words, the return is implicit.
Code: Select all
#UseHook
a::
+a::
SC027::
+SC027::
Send % RegExReplace(A_ThisHotkey, "\w") "{" RegExReplace(A_ThisHotkey, "\W") "}"
Return
#UseHook Off
Code: Select all
#SingleInstance Force
Loop {
WinWaitActive, ahk_exe notepad.exe
originalCapsLockState := GetKeyState("CapsLock", "T")
SetCapsLockState, Off
SoundBeep, 1500
WinWaitNotActive
SetCapsLockState, %originalCapsLockState%
SoundBeep, 1000
}
Re: Error The hotkey "e" will not be active because it does not exists in the current keyboard layout
Hi,
I have now used:
and it works fine. If CapsLock is pressed or no, letter "č" is always at lower key state as expected.
Now I have 4 more keys to do the same. I did:
Now I have tree more keys to do the magic, for keys:
"01B", "01A" and "02B", but for some reason this three keys do not work as above code. For example I did:
and when I reload the script I get error:
I have now used:
Code: Select all
SC027::
+SC027::
Send % RegExReplace(A_ThisHotkey, "\w") "{" RegExReplace(A_ThisHotkey, "\W") "}"
Return
Now I have 4 more keys to do the same. I did:
Code: Select all
SC028::
+SC028::
Send % RegExReplace(A_ThisHotkey, "\w") "{" RegExReplace(A_ThisHotkey, "\W") "}"
Return
"01B", "01A" and "02B", but for some reason this three keys do not work as above code. For example I did:
Code: Select all
01B::
+01B::
Send % Format("{{:" (Instr(A_ThisHotkey, "+") ? "U" : "L") "}}", RegExReplace(A_ThisHotkey, "\W"))
Return
I also tested last block of code from your previous sample (starting from #SingleInstance...) in separate script, made sure all AutoHotKeys programs are closed down, run the script, tested in Notepad, and it looks like no effect, all letters of alphabet appear like they are typed down respecting CapsLock key pressed or not pressed.Error at line 473.
Line Text: 01B::
Error: Invalid hotkey.
The script was not reloaded; the old version will remain in effect.
Re: Error The hotkey "e" will not be active because it does not exists in the current keyboard layout
01B is not the name of a key, hence the error.
Re: Error The hotkey "e" will not be active because it does not exists in the current keyboard layout
Hi,
in AutoHotKey keyboard detection I get:
- 01B for letter đ,
- 01A for letter š,
- 02B for letter ž
Please see attachment.
Regards
in AutoHotKey keyboard detection I get:
- 01B for letter đ,
- 01A for letter š,
- 02B for letter ž
Please see attachment.
Regards
- Attachments
-
- letters.jpg (222.57 KiB) Viewed 988 times
Re: Error The hotkey "e" will not be active because it does not exists in the current keyboard layout
Problem solved!!!
@gregster, thank you for your feedback. Sure I made a mistake and forgot to prepend "SC" in front of scan code.
@gregster, thank you for your feedback. Sure I made a mistake and forgot to prepend "SC" in front of scan code.