-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: show us intl keys #50
Comments
I think this is a duplicate of #32, except for the bonus section. That would require shipping data files that contain display forms of various keyboard layouts. Perhaps it would be possible by automatically parsing cldr files similar to https://github.com/joelspadin/zmk-locale-generator, while extracting shift/ralt keycodes. |
Re: the bonus section, it is relatively simple to override the |
Hi there. I'm experimenting with this feature, since the current behavior generates really ugly looking images on my setup: https://github.com/paoloantinori/zmk-config-zen-2/raw/uk/keymap-drawer/corneish_zen.svg?raw=true So far I've found that a funny improvement is to just make the layers:
BASE:
- - {t: '(ZMK HID USAGE(HID USAGE KEY, HID USAGE KEY KEYBOARD Q))', h: ESC}
- {t: '(ZMK HID USAGE(HID USAGE KEY, HID USAGE KEY KEYBOARD W))', h: TAB}
- (ZMK HID USAGE(HID USAGE KEY, HID USAGE KEY KEYBOARD E))
- (ZMK to this: layers:
BASE:
- - {t: GB Q, h: ESC}
- {t: GB W, h: TAB}
- GB E
- GB R Just to make a little progress here I've even added an extra config param to parse_config:
remove_prefixes:
- "GB" just to simplify the manipulation that led me to this output: layers:
BASE:
- - {t: ' Q', h: '$$mdi:keyboard-esc$$'}
- {t: ' W', h: '$$mdi:keyboard-tab$$'}
- ' E'
- ' R' with a very acceptable improvement over the output: https://github.com/paoloantinori/zmk-config-zen-2/blob/visual_editor/keymap-drawer/corneish_zen.svg But, I was hoping to have a real permanent solution to this approach and I've got a tip from @nickcoutsos who nicely shared his pre processing approach: nickcoutsos/keymap-editor#141 (reply in thread) I've managed to have his script working, so I see a path for a smart detection and delegation of the parsing logic to I stopped here and decided to ask for feedback on this thread because Open to any feedback! |
Locale headers like that are where our assumption of "preprocessed keycodes look like the short keycodes in Codes" breaks down, sadly. After reading your comment I thought about the issue further. I think one main assumption we can make is the following:
There are two ways I can think of how to approach to achieve this:
Looks like 2. is what you ended up on with above, but I am not sure how using ZMK locale generator helps here -- full disclosure, I don't get what Nick's script is exactly doing. One fundamental issue I see is that you don't know how the header was generated exactly, i.e. what locale and what prefix is used (from the discussion, looks like Nick makes some assumptions on that). Related to that and the two sub-bullets above, it looks like this cannot be fully automated. Anyway, 2. seems like a better way to go overall to me. Just need to figure out the preprocessor bit somehow. Maybe Nick's script that you got working is working around some of these issues? |
The script is mostly doing what As an example, {
"locale": "de",
"keys": [
...,
{
"names": [
"DE_CAPITAL_SHARP_S",
"DE_CAPITAL_ESZETT",
"DE_CAPITAL_SZ"
],
"symbol": "\u1e9e",
"modifiers": [
"LS",
"RA"
]
},
...
]
} Turning that into a flat map is left as an exercise for the reader, but the idea is that I can
So my assumptions is basically that: if someone uses zmk-locale-generator's headers they'll stick with that naming convention. Conversely, if someone has a |
Thanks Nick, seeing the output was helpful! One thing your approach made me realize is that perhaps it is OK to assume certain things about the locale generator headers. Specifically, if we assume headers are only among the pre-generated ones, we can automate things quite a bit:
...which sounds like your approach, essentially. I can see how this could be used by keymap-drawer in the following way:
I think that sounds less hacky than approach 2, but it constrain us to the assumption that users are using locale headers from releases. |
Meanwhile, I think it is a good idea to add |
Thanks for looking into this. The issue I have found in my experiments with Here I'm hacking things badly just to see if it can work and it seems so. But to keep things simple I've replaced the separating space in the keybinding, and also removed it in
This code works fine in my test |
For now, before a better/automated solution can be implemented as discussed above, I implemented these two things brought up by @paoloantinori 's approach:
When you combine these two, you should be able to implement the following workaround for locale headers:
Then any |
Thank you so much for this!! It works really well. I noticed a small problem in 1652cf9: It still uses the excluded header in |
Thank you. I've been fiddling with this over the last couple of days and it's working well! |
I ran into this same problem today, because I use the same trick as |
I am using a us-intl layout on windows and linux and i am missing letters like Ö, Ñ and Ø in the drawings.
I would like to see a blue layer like here: https://en.wikipedia.org/wiki/QWERTY#/media/File:KB_US-International.svg
Bonus: Ideally you could also specify that you are using i.e. a spanish, french or german layout and then the output is adapted to that language.
The text was updated successfully, but these errors were encountered: