-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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: Unicode #232
Comments
Thanks @yannickjmt. We hadn't had enough time to properly spec this yet, so thank you for getting it kick started. I suggest you search the Discord history for Your proposed approach is intriguing. A few initial questions if I may:
This probably needs to be considered in combination with #177 which is still open for ideas. To an extent, it probably also depends on a few core issues that are in progress (#21, #86, #153, #213). I realise QMK already has an approach to this, I'd encourage everyone to think outside the box for ZMK's approach and consider all options first. For completeness we also had an eye on this discussion kiibohd/KiiConf#30. |
There wasn't much in depth discussion on Discord from what I saw. Yes I pretty took QMK approach and simplified it with my limited understanding... |
fwiw; You can currently achieve this in a similar way QMK does it by using macros (PR pending), you'd have to change the 'Compose' key using a define depending on which OS you'd want to do this on This could perhaps be leveraged into its own behavior which takes a (string of) unicode character(s) and creates a macro with the unicode codepoint |
Hi, as someone who uses the unicode function in qmk and will be acquiring a keyboard running on zmk, I'd like to share some thoughts. Macros are not great.Here's why I recently got back into APL programming. In APL for example With Macros, you'd need to have two layers, one for the standard APL layer, and the other for the shifted APL layer. And that's fraught with errors. My previous configuration used macros, and I designated the shift key to be a momentary layer to the shifted APL layer. But somehow that didn't work (either because of repeated changes since, or something else). The unicode layer, with a shift support was excellent and worked first try. You need one more "OS" - emacsemacs has its own particular way of entering unicode characters (the default keybindings are: |
Having build-in unicode support would be fantastic, and OP's syntax suggestion for Regarding the previous comment: it is possible to implement shifted unicode versions in a single layer using mod-morph, but doing so is quite cumbersome and not very practical when trying to implement a whole layer of, say, Greek symbols. For example, to implement the second example from the OP, one could use the following code:
|
For anyone interested, I ended up creating a workaround based on preprocessor macros that lives entirely in userspace. It's not perfect, but might help until a native solution is available.
EDIT: The unicode helpers are now part of my collection of helper macros, available here: https://github.com/urob/zmk-nodefree-config. See the documentation there for details on how to set them up. Once sourced, unicode-keys can be created in two ways:
Final remark: Obviously, this is somewhat hacky and the syntax more cumbersome than a native solution would be. The constraint here is that the preprocessor can't detect types and can't loop. Hence the need to use arguments such as |
Good work herein @urob - will defs be using this for spanish characters whilst a more permanent solution presents itself. |
In some Apps (e.g. VSCode) typing a letter while holding Alt opens up the top menus and screws up the input. Too risky until zmkfirmware/zmk#232 is implemented.
In some Apps (e.g. VSCode) typing a letter while holding Alt opens up the top menus and screws up the input. Too risky until zmkfirmware/zmk#232 is implemented.
Any updates on this? This would really help people who need international characters from their countries layout with a en-us base layout. |
I'm not using ZMK currently, but to chime in on this I think using The solution I have now is sending the Example on how I do it from QMK, which should get you and idea on how to port this over to your layout in ZMK https://github.com/zapling/qmk-atreus62/blob/master/zapling/keymap.c#L58 |
In some Apps (e.g. VSCode) typing a letter while holding Alt opens up the top menus and screws up the input. Too risky until zmkfirmware/zmk#232 is implemented.
+1 |
1 similar comment
+1 |
Goal: Allow input of Unicode characters directly from the keyboard.
https://beta.docs.qmk.fm/using-qmk/software-features/feature_unicode for reference
As this is OS dependant, it will require a current_OS parameter that could ideally be controlled by the keyboard (&os WIN to switch to windows, &os LNX for linux, ...)
MacOS: add Unicode Hex Input in System Preferences > Keyboard > Input Sources. LAlt(Unicode_hex_code) for output.
Linux: Already enabled by default. Ctrl(Shift(u+Unicode_hex_code))+space for output.
Windows: Requires Wincompose program. RAlt(u+Unicode_hex_code)+enter for output.
A mapping of unicode hex codes should be available in the keymap.
The second code would be the shifted key
Ex:
#define EAIG &uc 00E9 00C9 // é É
#define NTIL &uc 00F1 00D1 // ñ Ñ
#define PI &uc 03C0 // π
then add them in a layer with &kp EAIG
Nice to have: override by config OS dependant unicode output sequences.
Allow output of chain of chars for stuff like (͡ ° ͜ʖ ͡ °) etc..
The text was updated successfully, but these errors were encountered: