UltimateHackingKeyboard / agent

Ultimate Hacking Keyboard configurator
https://ultimatehackingkeyboard.github.io/agent/
Other
701 stars 77 forks source link

Non-US layout support #2147

Open mondalaci opened 9 months ago

mondalaci commented 9 months ago

Some non-US users have trouble finding their desired scancodes since Agent only exposes US key symbols.

Let's include the following scancode to symbol mappings according to the offerings of the UHK 60 product page:

On the Settings page, Add a "Key language" option above the Theme option, including the default "US" option and the above options. This is an Agent setting, and it's not part of the configuration of the UHK.

According to the Key language option, visualize the key labels and populate the Scancode dropdowns of the keymap and macro pages accordingly.

seblovett commented 8 months ago

I think this also manifests itself in macros. I'm on a UK layout, and added a macro to type my email address. However, the @ symbol gets typed as a double quote (").

mondalaci commented 8 months ago

Yes, it's the same issue.

kareltucek commented 8 months ago

Is it? According to the above specification, this is agent only thing 🤨.

mondalaci commented 8 months ago

It's an OS layout scancode-related issue, but the specification doesn't address text macro actions, which would be harder to address due to translating characters to AltGr combinations and such.

mortenbentsen commented 5 months ago

Consider this a bump/+1 on this issue/feature request.

Being from the nordics, and using a mac, I feel like I'm at difficulty 11 just getting down the bare basics on the UHK :P

piratk commented 4 months ago

This has been an big issue since day one of macro-support for UHK, at least for all non-US keyboard users. For Windows users, I suggest having a device driver that provides some translation support for the currently used keyboard language. If it does the translation while programming the keyboard or while running the macro is not really important for many users, all though in the former case the macro support would still work in non-windows environments, kind of anyway.

rpnfan commented 2 months ago

I have seen that Oryx has a nice solution to support different locale keyboards. You can use that as an inspiration. One can play around with Oryx without a keyboard.

https://configure.zsa.io/home

image

mondalaci commented 2 months ago

Thanks for the idea! I wasn't aware of Oryx's solution, and I can see its merit. It's a bit misleading, though, because according to the OS locale, the same scancode can translate to numerous characters. Agent and the UHK would also have to store per-scancode locale metadata. Per-layer or per-keymap locale metadata might make more sense, but I can't see the use cases clearly.

rpnfan commented 2 months ago

because according to the OS locale, the same scancode can translate to numerous characters

That is exactly what is nice here. You choose one locale, not several, in the settings (cog wheel - lnternational). Then Oryx will display you the characters which are available for the given locale setting. So nothing is misleading, in contrast. You just have to match your OS keyboard setting in the Oryx settings. One locale setting is "US International", which is nice, because that can be a good keyboard locale setting for many multi-lingual people. It then displays all characters available with that US locale.

AFAIU you can not switch complete layouts with ZSA keyboards, so that is something the UHK would need to handle in Agent as well -- matching the locale to a specific UHK layout. But then this would be the perfect solution I think.

mondalaci commented 2 months ago

By "UHK layout", I assume you mean UHK keymap. Keymap-specific locales would probably make sense.

rpnfan commented 2 months ago

Yes, I meant keymap indeed. :-) ZSA keyboards only seem to have one, you can not switch to others -- without reflashing the complete board. At least that was my impression. So here the UHK would need a mapping between keymap and locale. In Oryx you could turn on multiple locales, but that does not make sense. From a UX point of view those should be implemented with a radio button.

When this concept is implemented you could start with German, UK, US International and then add other locales as needed. Oryx now seems pretty complete with about 30 locale settings covering a large portion of possible users.

mhantsch commented 4 weeks ago

Once you have that locale config button, you could then add a kind of Auto-detect that I suggested a while ago. Agent would trigger the UHK to send certain scan codes, and check which characters it got sent by the OS. Agent would use this to check a few specific keys and then select one of the supported locales.