AHK isn't detecting the keys in my layout correctly

Report problems with documented functionality
Stamimail
Posts: 77
Joined: 06 Nov 2014, 08:48

AHK isn't detecting the keys in my layout correctly

04 Jul 2017, 15:42

My layout: Hebrew
For example:

Code: Select all

q::MsgBox, test
I get:

Code: Select all

Note: The hotkey q will not be active because it does not exist in the current keyboard layout.
I do have a `q` key in my layout,
It isn't working..
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: AHK isn't detecting the keys in my layout correctly

04 Jul 2017, 16:30

If the layout is on hebrew, you dont have a q, you can test to use the scan code for q

Code: Select all

sc010::msgbox,test
Good luck.
Stamimail
Posts: 77
Joined: 06 Nov 2014, 08:48

Re: AHK isn't detecting the keys in my layout correctly

04 Jul 2017, 16:43

Helgef wrote:If the layout is on hebrew, you dont have a q, you can test to use the scan code for q

Code: Select all

sc010::msgbox,test
Good luck.
I do have.
Trying both English and Hebrew layouts:
ABCQ
and
אבג/ (while / is the character in the hebrew layout where is q in English)
with the code you gave, made the msgbox launched.
Stamimail
Posts: 77
Joined: 06 Nov 2014, 08:48

Re: AHK isn't detecting the keys in my layout correctly

25 Oct 2017, 05:33

Is the following thread helps? It contains things like chcp/codepage etc
https://www.voidtools.com/forum/viewtop ... f=2&t=5827
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: AHK isn't detecting the keys in my layout correctly

26 Oct 2017, 11:34

I do have.
If your layout is on hebrew, you don't have a q, it doesn't matter if there is a label on the keyboard saying q. On hebrew, that key is /.
I do not have an א on my keyboard, hence,

Code: Select all

א::msgbox שלום
doesn't work unless I set my layout to hebrew, then it does. I'm sorry if I missunderstand you.

Cheers. :wave:
Stamimail
Posts: 77
Joined: 06 Nov 2014, 08:48

Re: AHK isn't detecting the keys in my layout correctly

26 Oct 2017, 13:03

I think it would be better not to use the word "layout". Let's use "Keyboard input".

You shouldn't make AHK like this.
The hotkey should be launched, no matter what the "Keyboard input" is. It's very simple to me.
For example:
Ctrl+C and Ctrl+V (Copy/Paste).
In Hebrew OS (and I think this is the way in any language), we use Ctrl+C for copy, and Ctrl+V for paste.
This behavior isn't depended the Keyboard input language!
This is because, when you use 2 languages, you switch the Keyboard input [Alt+Shift] almost every secnod.
You need the same action, without put attention what is the current Keyboard input is.
Try to think:
Alt+Tab for swithcing windows, you land on a window, and just want to paste the content of the clipboard.
Do you think the user needs to check what is the current Keyboard input setting before making the Ctrl+V? It's impossible.

Related:
https://autohotkey.com/boards/viewtopic ... 14&t=38968
https://www.voidtools.com/forum/viewtop ... f=7&t=6095
Stamimail
Posts: 77
Joined: 06 Nov 2014, 08:48

Re: AHK isn't detecting the keys in my layout correctly

27 Oct 2017, 07:34

Code: Select all

sc010::msgbox,שלום וברכה
The problem to use this method:
1. Of course, "sc010" is much less intuitive, and requires more letters to type and remember.
2. IMPORTANT - Compatibility - Almost every script in forum can be considered broken for me. You can't use it like that.

https://autohotkey.com/boards/viewtopic ... 79#p178097
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: AHK isn't detecting the keys in my layout correctly

27 Oct 2017, 11:31

I think this is by design, part ahk design and part OS design.
1) You can use getkeysc and the hotkey command to set up your own hotkeys. For example,

Code: Select all

scHotkey(["q","/"], "qSlashLabel")
return 

qSlashLabel:
	msgbox % A_ThisHotkey
return
esc::exitapp
scHotkey(keys, fnOrLabel){
	local k, key, sc
	for k, key in keys
		if sc:= getkeysc(key)	
			break
	if !sc
		return false
	sc := format("sc{:x}", sc)
	hotkey, % sc, % fnOrLabel
}
2 ) Can't you set your keyboard to english when you start the script. Then it works right? Consider this,

Code: Select all

q::msgbox
For me, the hotkey works if I set my keyboard to hebrew after I started the script on english.
Stamimail
Posts: 77
Joined: 06 Nov 2014, 08:48

Re: AHK isn't detecting the keys in my layout correctly

28 Oct 2017, 14:55

1. Sorry, I don't understand.
2. I tested on my W7 x64 Hebrew.
Portbale:
AutoHotkeyU64.exe
AutoHotkeyU64.ahk
q::msgbox

No matter what Keyboard Input is (En or He), start running the AutoHotkeyU64.exe I get this:

Image

BTW, solution like this
Can't you set your keyboard to english when you start the script.
seems to me like a joke. it's not a good one.
Stamimail
Posts: 77
Joined: 06 Nov 2014, 08:48

Re: AHK isn't detecting the keys in my layout correctly

28 Oct 2017, 16:14

Helgef wrote: For me, the hotkey works if I set my keyboard to hebrew after I started the script on english.
https://autohotkey.com/boards/viewtopic ... 68#p178432
lexikos
Posts: 9553
Joined: 30 Sep 2013, 04:07
Contact:

Re: AHK isn't detecting the keys in my layout correctly

27 Dec 2017, 17:33

This should no longer be an issue 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.
Stamimail
Posts: 77
Joined: 06 Nov 2014, 08:48

Re: AHK isn't detecting the keys in my layout correctly

27 Dec 2017, 17:42

I'll try it. Thanks for your help.
Stamimail
Posts: 77
Joined: 06 Nov 2014, 08:48

Re: AHK isn't detecting the keys in my layout correctly

31 May 2018, 05:45

Till now the fix worked, thanks.
Just found this:
Image

The key above the Tab.

Code: Select all

`::msgbox works
just me
Posts: 9424
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: AHK isn't detecting the keys in my layout correctly

31 May 2018, 09:32

As far as I can see:
lexikos wrote:This should no longer be an issue for the a-z keys due to: ...
Stamimail
Posts: 77
Joined: 06 Nov 2014, 08:48

Re: AHK isn't detecting the keys in my layout correctly

05 Jun 2018, 05:46

just me wrote:As far as I can see:
lexikos wrote:This should no longer be an issue for the a-z keys due to: ...
Is this bug going to stay in the next version too?
guest3456
Posts: 3454
Joined: 09 Oct 2013, 10:31

Re: AHK isn't detecting the keys in my layout correctly

05 Jun 2018, 08:41

Stamimail wrote:Is this bug going to stay in the next version too?
its not a bug. just use the scancode or VK as was already suggested earlier in this thread. write a comment in your script to help you remember what it does since its not intuitive

Stamimail
Posts: 77
Joined: 06 Nov 2014, 08:48

Re: AHK isn't detecting the keys in my layout correctly

05 Jun 2018, 09:17

its not a bug.
Do you understand that this mean that whenever someone is assigning Alt+` and compile his script, I can't use his program?
guest3456
Posts: 3454
Joined: 09 Oct 2013, 10:31

Re: AHK isn't detecting the keys in my layout correctly

05 Jun 2018, 09:19

Stamimail wrote:
its not a bug.
Do you understand that this mean that whenever someone is assigning Alt+` and compile his script, I can't use his program?
you can use it if you change your keyboard layout to English, or any layout that has the ` character

if you assign a ג hotkey, then i can't use your program either.

if someone wants to make it compatible for both layouts, then they can use the SC or VK method

Stamimail
Posts: 77
Joined: 06 Nov 2014, 08:48

Re: AHK isn't detecting the keys in my layout correctly

05 Jun 2018, 09:30

The same thing you could say for
Ctrl+C
Ctrl+V

It's actually
Ctrl+ב
Ctrl+ה

For Hotkeys, you need the English character to work in Hebrew Layout (i.e no matter what the Keyboard Layout is).

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 31 guests