Skip to content
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

Allow unicode up to 0xFFFFF using separate mapping table #815

Merged
merged 2 commits into from
Oct 16, 2016
Merged

Allow unicode up to 0xFFFFF using separate mapping table #815

merged 2 commits into from
Oct 16, 2016

Conversation

priyadi
Copy link
Contributor

@priyadi priyadi commented Oct 9, 2016

This allows unicode input up to 0xFFFFF using a mapping table in keymap file.

Some notes:

  • To use, add UNICODEMAP_ENABLE = yes in Makefile
  • Takes the range 0x7800-0x78FF in keycodes, hence a maximum of 2048 unicode characters are supported in a single keymap file.
  • Need a mapping array in keymap file in the form of const uint32_t PROGMEM unicode_map[] = ...
  • Uses the macro X() in keymap file, to refer to a value in mapping table.
  • Could easily support up to 0xFFFFFFFF, but Linux only supports inputting 5 characters max, so I'm limiting to 5 bytes for now.

@algernon
Copy link
Contributor

algernon commented Oct 9, 2016

This appears to be doing something very similar to UCIS, perhaps it would make sense to use the same table UCIS does, so both functionality could benefit?

@priyadi
Copy link
Contributor Author

priyadi commented Oct 10, 2016

@algernon I don't see how it could be possible. UCIS uses sequence of characters for input, this uses a single keystroke. Even if it is doable, it would require significantly more program space, and we still need to maintain a mapping table one way or another anyway. But, I'm open to suggestions, please see my keymap to see how this is implemented.

We should probably refactor the three unicode input methods, and separate the common functions to a file and make the different input methods to reside in separate files.

@algernon
Copy link
Contributor

The way it enters the code is different, because I didn't get register_code32 working reliably. UCIS could, I think, use the same way of input you have written. And then, the only difference would be that with UCIS, the user types in the lookup key, and with your method, it's bound to a key instead. The same table could be used for both, but that needs UCIS to change how it enters chars...

Come to think of it, I could migrate UCIS to be based on your code, when this PR gets merged... then you don't have to worry about it at all :)

@jackhumbert
Copy link
Member

Great! Thanks :)

@jackhumbert jackhumbert merged commit 52d7f7d into qmk:master Oct 16, 2016
BlueTufa pushed a commit to BlueTufa/qmk_firmware that referenced this pull request Aug 6, 2021
fix the layout to be same with keymap.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants