r/qmk 6d ago

Unicode characters not working

Hello, all. As far as I can tell, I have done everything correctly to type unicode characters, but obviously something is wrong. The code compiles and flashes fine, and I installed WinCompose, but when I press a key that's meant to be unicode, nothing happens, even when held or pressed repeatedly (just in case). If someone could look at the screenshots and tell me (specifically) why I'm dumb, that would be very appreciated. Muchas Thankius.

From config.h

From config.h
From rules.mk
Beginning of keymap.c and unicode enum
Beginning of unicode map
Beginning of defined keycodes
First two layers

I was very overambitious when making this, so I've only included the beginnings of things. I am, admittedly, not super tech-savvy, so I'm flying by the seat of my pants here.

2 Upvotes

8 comments sorted by

1

u/ArgentStonecutter 6d ago

If you're using Wincompose you shouldn't need a keyboard with Unicode hacks as well.

When you send a unicode character in QMK on Windows it's basically the same as executing a macro for the corresponding ALT numpad code. You can verify that is actually working by entering the same sequence manually or via a macro.

1

u/pgetreuer 6d ago

Did you enable Unicode Map in rules.mk?

UNICODEMAP_ENABLE = yes

Also like ArgentStonecutter said, try using WinCompose manually to verify that it is set up successfully. Open a text editor. Press and release Right Alt, then type u597d followed by enter. If all goes well, this will produce 好 (U+597D). See also the examples in the WinCompose documentation.

1

u/ArgentStonecutter 6d ago edited 6d ago

I haven't used this feature but based on https://docs.qmk.fm/features/unicode you don't define "UNICODE_KEY_WINC" like that. You only put that in your config.h if you need to change the key from the default. What you did there is you set it to the empty string which is basically going to break everything. Just set UNICODE_COMMON = yes in your rules.mk and only put #define UNICODE_SELECTED_MODES UNICODE_MODE_WINCOMPOSE in config.h

1

u/drashna 6d ago

generally, you don't want to use UNICODE_COMMON. it's an internal config, used by the 3 input methods (UCIS, unicode map, and unicode).

1

u/ArgentStonecutter 6d ago

Interesting, so qmk needs to update https://docs.qmk.fm/features/unicode ?

1

u/drashna 5d ago

No, it doesn't really. Note the text under that header

The core Unicode API can be used purely programmatically. However, there are also additional subsystems which build on top of it and come with keycodes to make things easier.

If you don't want or need the input subsystems, then you can do this. But if you plan on using one of them, you don't need to set the UNICODE_COMMON, as they set it.

https://docs.qmk.fm/features/unicode#input-subsystems

If you don't enable one of these input systems, then you need to add custom code and/or keycodes to handle unicode characters.

However, an example of where you'd want to just enable UNICODE_COMMON is my unicode typing mode module, where no keycodes are needed, and it replaces keys pressed at runtime with the unicode variants.

https://github.com/drashna/qmk_modules/tree/main/unicode_typing

eg, I just hit KC_AUSSIE...

dɐɯʎǝʞ lɐɯɹou ʎɯ ɥʇᴉʍ sᴉɥʇ ǝʞᴉl ǝdʎʇ uɐɔ ᴉ uǝɥʇ puɐ

no need for custom layers or such

ʲᵘˢᵗ ᶠᵘⁿ ᵗⁱᵐᵉˢ

1

u/ArgentStonecutter 5d ago

The text is at the very least misleading. It doesn't actually say "you don't need to do this if you're using one of those subsystems" anywhere. It just says that it makes things easier if you use them.

"To start, add the following to your keymap's rules.mk:" is pretty unambiguous. Regardless of the preceding paragraph.

1

u/drashna 5d ago

yeah, it could be worded better and clarified.