2nd-keyboard icon indicating copy to clipboard operation
2nd-keyboard copied to clipboard

Your code is probably incompatible with non US layouts

Open zurbo opened this issue 8 years ago • 9 comments

Here is the problem: for exemple in france we have AZERTY layout and where US layout have the semicolon key we have the 'M' key. so what is the problem ? [186] = "semicolon", ... [string.byte('M')] = "m", the 'M' key on a french keyboard will take the code 186 which is already taken by the semicolon. On ISO Layouts keyboards there is also one more key (at the right of the left shift) this key is not declared in your script :'( (I will try to fix this too)

zurbo avatar Apr 08 '16 07:04 zurbo

Could include a locales folder which would have maps of all key codes to characters. Surely this already exists somewhere?

tom-sherman avatar Apr 08 '16 08:04 tom-sherman

Yes but i don't think this is a good solution because there is a lot of differents layouts .... and some custom layouts too ..

zurbo avatar Apr 08 '16 08:04 zurbo

Wouldn't this sort of thing work?

[string.byte(';')] = "semicolon"

That would solve the special character problem.

tom-sherman avatar Apr 08 '16 08:04 tom-sherman

err I don't know :') We have some very specials keys on our layout like "$£¤" (normal, maj, alt GR) which char represent that key ?_?

zurbo avatar Apr 08 '16 08:04 zurbo

OK I have tested the script with an azerty keyboard: 2 keys are not reconised (at the left of the right shift key and at the right of the left shift key) BUT all the others keys have a unique identifier (the script can distinct m key and semicolon which is weird to me :'))

zurbo avatar Apr 08 '16 09:04 zurbo

I think an important thing to remember here is that keycodes != character codes.

tom-sherman avatar Apr 08 '16 10:04 tom-sherman

I'm using Latin American layout in my US keyboard. So, for example, when I press the key above TAB I get this: | I have no idea how to get the tilde (`) that is both printed on the physical keyboard and in the "F1F2F3F4 - Program Launcher" script on line 101 , so for my personal use, I replaced that character with "|", which is what I get when I press the key on top of TAB.

I guess that I'll have to replace all of these keys that are changed in the Latin American layout. Notable ones:

; is ñ for me ' is { for me / is - for me [ is ´ for me (to make á é í ó ú) { is ¨ for me (to make ä ë ï ö ü) ] is + for me \ doesn't exist! ^ doesn't exist!!! (I use ALT+94 since as a math-lover this character is important) = is ¿ for me

And well, you get the point. In the end, all the software that I know use the characters rather than the keys for shortcuts. Then if you use a different layout and can't change the shortcuts easily (like AfterEffectson Windows!!!!) then you're kind of screwed.

Not sure if this would be solved by having the software using the keys rather than the characters or if there is an easy way around this issue other than manually changing the shortcuts for every piece of software to match the intended or desired US layout.

EverSalazar avatar Nov 20 '16 23:11 EverSalazar

You're right Ever, I did awaken something in you. hehehe. Anyway, this thread seems to be about the .lua script and luamacros..... that's obsolete now! Intercept is way better, and more stable. I recommend that everyone switch. A bit harder to set up (you need to run a command prompt as administrator, and do a bunch of annoying install stuff) but it's much better.

TaranVH avatar Nov 21 '16 19:11 TaranVH

Even the AHK scripts have problems with CZECH layouts...

Matesaktesak avatar Jan 27 '19 10:01 Matesaktesak