The hotkey #q will not be active because it does not exist in the current keyboard layout. Topic is solved

Report problems with documented functionality
voidbent
Posts: 14
Joined: 19 Feb 2016, 13:43
Contact:

The hotkey #q will not be active because it does not exist in the current keyboard layout.

02 Jun 2016, 08:18

From time to time I randomly get the following note message while starting AutoHotkey: "Note: The hotkey #q will not be active because it does not exist in the current keyboard layout"

Appropriate hot key is defined like this:

Code: Select all

#q::
  SendInput {U+0301}
  return
I use AutoHotkey v1.1.24.00
lexikos
Posts: 9553
Joined: 30 Sep 2013, 04:07
Contact:

Re: The hotkey #q will not be active because it does not exist in the current keyboard layout.

02 Jun 2016, 21:46

I would guess that from time to time you randomly change your default keyboard layout to one where 'q' does not exist...

It is unlikely to be a bug. If it matters, I have been using #q as a hotkey for years and never had that problem, except (as expected) when using a keyboard layout which does not assign the letter 'q' to a key.
voidbent
Posts: 14
Joined: 19 Feb 2016, 13:43
Contact:

Re: The hotkey #q will not be active because it does not exist in the current keyboard layout.

14 Nov 2017, 12:36

lexikos wrote:I would guess that from time to time you randomly change your default keyboard layout to one where 'q' does not exist...
No, I don't. I can run AutoHotkey 3 times in a row and it will show me the error 2 out of 3 times. I don't change default keyboard layout between runs.
lexikos wrote:It is unlikely to be a bug. If it matters, I have been using #q as a hotkey for years and never had that problem, except (as expected) when using a keyboard layout which does not assign the letter 'q' to a key.
I've been using #q as a hotkey for maybe a decade already, and the bug reproduces for several years. It reproduces on all PCs that I'm using.
Guest

Re: The hotkey #q will not be active because it does not exist in the current keyboard layout.

14 Nov 2017, 13:49

Perhaps the programs you're using do "something" to your keyboard layout, who knows. Perhaps another hotkey/hotstrings is sending a key-combo that switches your keyboard language and you don't notice. Or it is just a mystery ;)

Is it only #q or other keys as well? If it is just #q why don't you switch to using the scancode for the key so it always works regardless of layout? See https://autohotkey.com/docs/KeyList.htm#SpecialKeys
voidbent
Posts: 14
Joined: 19 Feb 2016, 13:43
Contact:

Re: The hotkey #q will not be active because it does not exist in the current keyboard layout.

14 Nov 2017, 16:19

Guest wrote:Perhaps the programs you're using do "something" to your keyboard layout, who knows. Perhaps another hotkey/hotstrings is sending a key-combo that switches your keyboard language and you don't notice. Or it is just a mystery ;)
I don't have any other keyboard/language related applications installed.
Guest wrote:Is it only #q or other keys as well?
All other WinKey+Letter keys behave in the same way. An error message appears for each single WinKey+Letter hotkey I use in my script.
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: The hotkey #q will not be active because it does not exist in the current keyboard layout.

14 Nov 2017, 16:27

- So, sometimes you get the problem, sometimes you don't. What regularity, roughly?
- Was there a time period when the script would always work correctly, and then at some point you got the occasional error?
- If you create a new script like the one below, and close all other scripts:

Code: Select all

#q::
MsgBox, % A_ThisHotkey
return
Does it work? If so, sometimes when I've had major problems, that I don't understand the cause of, I copy the script, and delete chunks of it until the problem goes away, and try and pinpoint where the problem is.
- Do you have any problems with other hotkeys?
- If you create hotkeys like #w or ^q, do they work?
- After the error, does the script actually run as expected, or are there problems.
- What language settings do you use, have you ever changed them?
- Do you have any other keyboard-related software?
Cheers.

[EDIT:]
- File encoding issues? I.e. what is the encoding of the script?
- Try and think of anything keyboard-related, or anything in the script, that could be a source of the problem.
- A workaround script:

Code: Select all

LWin & q::
RWin & q::
MsgBox, % A_ThisHotkey
return
- Is there any weird code near any of the #q hotkey labels? Or weird, possibly invisible, characters.
- Try commenting out all of the #q hotkeys, and adding a new one at the bottom of the script.
- I had this problem at some point last year it turns out, I don't know what caused it, but I must have fixed it. If you try the things that I suggested, hopefully you'll be able to figure something out.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
voidbent
Posts: 14
Joined: 19 Feb 2016, 13:43
Contact:

Re: The hotkey #q will not be active because it does not exist in the current keyboard layout.

14 Nov 2017, 18:10

jeeswg wrote:- What language settings do you use, have you ever changed them?
It appears that this is what causes the problem. Thanks for helping me to figure it out!

I have "English (United States)", "Russian (Ukraine)" and "Ukrainian (Enhanced)" languages installed. The script doesn't work if the current language is Russian or Ukrainian at the moment when I start AutoHotkey (both languages use Cyrillic instead of Latin alphabet).

If I start AutoHotkey when current language is "English (United States)" and then change it to Russian or Ukrainian, the script works as expected and #q hotkey works as well. So I assume it must be some problem in keyboard layout detection.
lexikos
Posts: 9553
Joined: 30 Sep 2013, 04:07
Contact:

Re: The hotkey #q will not be active because it does not exist in the current keyboard layout.

15 Nov 2017, 02:01

Hotkeys are registered at program startup, using the keyboard layout which is active at the time. This is by design.
voidbent
Posts: 14
Joined: 19 Feb 2016, 13:43
Contact:

Re: The hotkey #q will not be active because it does not exist in the current keyboard layout.

15 Nov 2017, 10:11

lexikos wrote:Hotkeys are registered at program startup, using the keyboard layout which is active at the time. This is by design.
Is there any way to change this default behavior?

#q hotkey works in Russian and Ukrainian languages, so I'd prefer to change keyboard layout to English (United States) before hotkey initialization and then change it back in my script.
lexikos
Posts: 9553
Joined: 30 Sep 2013, 04:07
Contact:

Re: The hotkey #q will not be active because it does not exist in the current keyboard layout.  Topic is solved

27 Dec 2017, 17:14

This should no longer happen for the a-z keys due to:
v1.1.27.00 wrote:Changed a-z to mean vk41-vk5A when absent from the keyboard layout, except with Raw mode or when sending single unmodified characters. This allows hotkeys and sent keyboard shortcuts to work more intuitively on certain non-English keyboard layouts.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 39 guests