-
-
Notifications
You must be signed in to change notification settings - Fork 40.2k
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 easy switching/cycling between Unicode input modes #4221
Allow easy switching/cycling between Unicode input modes #4221
Conversation
d61e0b2
to
78083de
Compare
Konstantin - this looks to provide the exact functionality that I need for unicode input mode cycling. Is there anything that I can do to help get it over the line? |
@bit-shifter I need to add the new functionality to the docs, but that shouldn't be a problem as it'll more or less be a copy-paste of the description I wrote in the PR comment. Just need to get around to doing it. Other than that I've been thinking about adding a predefined keycode that calls |
Honestly, I think that we need keycodes for all of the Unicode modes. |
That sounds good too. Have keycodes that change to a specific input mode — as well as one that cycles through a predefined set of input modes selected by the user (the most common use case being toggling between two modes). Should there be a keycode for |
6a6b36c
to
8e258a7
Compare
I've separated this from the changes in #4217 and have rebased the branch onto the latest master. If someone else could test it, that'd be much appreciated 😄 |
8e258a7
to
9a7fc36
Compare
And link to the file instead. Link to specific lines later on.
Co-Authored-By: drashna <drashna@live.com>
Co-Authored-By: drashna <drashna@live.com>
Co-Authored-By: drashna <drashna@live.com>
Co-Authored-By: drashna <drashna@live.com>
Co-Authored-By: drashna <drashna@live.com>
Co-Authored-By: drashna <drashna@live.com>
Co-Authored-By: drashna <drashna@live.com>
Co-Authored-By: drashna <drashna@live.com>
Co-Authored-By: drashna <drashna@live.com>
* case alignment * process_record_unicode_common → process_unicode_common * Move song arrays into function where they're used, align preprocessor directives * Swap the order of UC_WIN and UC_BSD * Update Unicode docs * Reorder Unicode mode stuff to match the order of input mode constants * Fix capitalization in doc subtitle * Readd BSD and OSX_RALT songs * Reword BSD note in docs * Readd BSD keycode description * Reword explanation of input on different platforms
Co-Authored-By: vomindoraan (vomindoraan@gmail.com)
Co-Authored-By: drashna <drashna@live.com>
// Comma-delimited, ordered list of input modes selected for use (e.g. in cycle) | ||
// Example: #define UNICODE_SELECTED_MODES UC_WINC, UC_LNX | ||
#ifndef UNICODE_SELECTED_MODES | ||
#define UNICODE_SELECTED_MODES -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be better default behavior to default all modes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the default should be that the feature is disabled by default — that way it's opt-in only. This minimizes the chance of anything breaking. For example, if it were enabled by default, some boards that are close to the firmware size limit would break because the feature uses extra memory (namely the selected
array).
* Standardize the Unicode EEPROM code * Remove unicode init from process_record_* functions * Add unicode init to where it belongs: matrix_init_quantum * Move Unicode proccessing to unicode common * Add audio feedback to input mode keys to drive konstantin up a wall * Tap_code cleanup * Update keycodes * Update unicode documentation * Update unicode keycodes for consistency/easier merge * Add Audio Feedback section * Remove Functions from feature page And link to the file instead. Link to specific lines later on. * Fix white spaces Co-Authored-By: drashna <drashna@live.com> * Fix spacing Co-Authored-By: drashna <drashna@live.com> * Because I missed it! Co-Authored-By: drashna <drashna@live.com> * Fix spacing Co-Authored-By: drashna <drashna@live.com> * SPAAAAAAAAAACing Co-Authored-By: drashna <drashna@live.com> * white spaces Co-Authored-By: drashna <drashna@live.com> * Add BSD for future compatibility * Thought I fixed that! Co-Authored-By: drashna <drashna@live.com> * non-breaking Co-Authored-By: drashna <drashna@live.com> * Considered that Co-Authored-By: drashna <drashna@live.com> * Yuuup Co-Authored-By: drashna <drashna@live.com> * consistency Co-Authored-By: drashna <drashna@live.com> * white spaces .... copied from elsewhere Co-Authored-By: drashna <drashna@live.com> * white spaces Co-Authored-By: drashna <drashna@live.com> * white spaces Co-Authored-By: drashna <drashna@live.com> * Update keycode defines * Fix Linux Song * Update all of the songs * Cleanup * Move and update check to ensure only one unicode method is enabled * Update quantum/quantum_keycodes.h * Update documentation * Wordsmithing and cleanup * Format unicode_common (qmk#13) * case alignment * process_record_unicode_common → process_unicode_common * Move song arrays into function where they're used, align preprocessor directives * Swap the order of UC_WIN and UC_BSD * Update Unicode docs * Reorder Unicode mode stuff to match the order of input mode constants * Fix capitalization in doc subtitle * Readd BSD and OSX_RALT songs * Reword BSD note in docs * Readd BSD keycode description * Reword explanation of input on different platforms * Steal vomindoraan's input mode documentation Co-Authored-By: vomindoraan (vomindoraan@gmail.com) * Willingly give Drashna the rest of my Unicode doc improvements * Wordsmithing Co-Authored-By: drashna <drashna@live.com> * Rearrange process_unicode_common functions * Make Unicode input mode constants (UC_*) an enum * Simplify unicode_input_start/finish code * Make the key used for WinCompose configurable * Remove UC_OSX_RALT in favor of setting the key with UNICODE_OSX_KEY * Update Unicode input mode doc * Add descriptions and rearrange definitions in process_unicode_common.h * Add registry command to Unicode docs + misc updates * Reword an explanation in Unicode docs * Add TODO comment * Remove trailing whitespace
…nicode_input_mode_new
These changes have been incorporated into #4325. |
Note: drashna:make_unicode_init has been merged into this as #4325 will likely be merged soon.
If you are reviewing this, click here to view the changes from that branch to this one. Those are the actual changes that this PR will introduce once #4325 is merged.
The old changes are available on vomindoraan:cycle_unicode_input_mode_new_backup.
Using a board with multiple OS's is a common occurrence. This adds an easy, declarative way of choosing and switching between Unicode input modes when you move from OS to OS. Here's how:
config.h
as follows:#define UNICODE_SELECTED_MODES UC_WINC, UC_LNX
.UC_MOD
(and optionallyUC_RMOD
) to switch between modes.If you select more than two modes, QMK will go through them cyclically, in the order they were specified, starting with the first.
UC_MOD
cycles forward andUC_RMOD
cycles in reverse. For example:As a consequence, you don't need to call
set_unicode_input_mode()
ineeconfig_init_user()
anymore if you're using this feature, since the input mode will automatically be initialized to the first one you specified in the list (but you still can if you want to).The changes are written to EEPROM by default. This means that you only need to switch the input mode when changing machines, as the last picked mode will be stored between uses on the same OS. You can disable this by adding
#define UNICODE_CYCLE_PERSIST false
to yourconfig.h
. Do this if you want to conserve your EEPROM, or want the board to always boot with the first input mode in your list. You can then callpersist_unicode_input_mode()
yourself if you want to save the input mode on demand.Note: This PR only adds new functionality and shouldn't change existing Unicode behavior.
To-do