Page 1 of 2

AHK isn't detecting the keys in my layout correctly

Posted: 04 Jul 2017, 15:42
by Stamimail
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..

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

Posted: 04 Jul 2017, 16:30
by Helgef
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.

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

Posted: 04 Jul 2017, 16:43
by Stamimail
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.

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

Posted: 25 Oct 2017, 05:33
by Stamimail
Is the following thread helps? It contains things like chcp/codepage etc
https://www.voidtools.com/forum/viewtop ... f=2&t=5827

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

Posted: 26 Oct 2017, 11:34
by Helgef
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:

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

Posted: 26 Oct 2017, 13:03
by Stamimail
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

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

Posted: 27 Oct 2017, 07:34
by Stamimail

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

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

Posted: 27 Oct 2017, 11:31
by Helgef
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.

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

Posted: 28 Oct 2017, 14:55
by Stamimail
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.

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

Posted: 28 Oct 2017, 16:14
by Stamimail
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

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

Posted: 27 Dec 2017, 17:33
by lexikos
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.

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

Posted: 27 Dec 2017, 17:42
by Stamimail
I'll try it. Thanks for your help.

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

Posted: 31 May 2018, 05:45
by Stamimail
Till now the fix worked, thanks.
Just found this:
Image

The key above the Tab.

Code: Select all

`::msgbox works

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

Posted: 31 May 2018, 09:32
by just me
As far as I can see:
lexikos wrote:This should no longer be an issue for the a-z keys due to: ...

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

Posted: 05 Jun 2018, 05:46
by Stamimail
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?

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

Posted: 05 Jun 2018, 08:41
by guest3456
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

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

Posted: 05 Jun 2018, 09:17
by Stamimail
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?

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

Posted: 05 Jun 2018, 09:19
by guest3456
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

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

Posted: 05 Jun 2018, 09:27
by Helgef
@ guest3456 :thumbup:

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

Posted: 05 Jun 2018, 09:30
by Stamimail
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).