aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/feature_unicode.md16
-rw-r--r--docs/keycodes.md2
-rw-r--r--keyboards/signum/3_0/elitec/keymaps/default/layout.py2
-rw-r--r--quantum/process_keycode/process_unicode_common.c22
-rw-r--r--quantum/process_keycode/process_unicode_common.h15
-rw-r--r--quantum/process_keycode/process_unicodemap.c2
-rw-r--r--quantum/quantum_keycodes.h6
-rw-r--r--users/drashna/config.h2
-rw-r--r--users/kuchosauronad0/config.h2
9 files changed, 41 insertions, 28 deletions
diff --git a/docs/feature_unicode.md b/docs/feature_unicode.md
index 697541458..a6f2cb4d0 100644
--- a/docs/feature_unicode.md
+++ b/docs/feature_unicode.md
@@ -90,13 +90,15 @@ Unicode input in QMK works by inputting a sequence of characters to the OS, sort
90 90
91The following input modes are available: 91The following input modes are available:
92 92
93* **`UC_OSX`**: macOS built-in Unicode hex input. Supports code points up to `0xFFFF` (`0x10FFFF` with Unicode Map). 93* **`UC_MAC`**: macOS built-in Unicode hex input. Supports code points up to `0xFFFF` (`0x10FFFF` with Unicode Map).
94 94
95 To enable, go to _System Preferences > Keyboard > Input Sources_, add _Unicode Hex Input_ to the list (it's under _Other_), then activate it from the input dropdown in the Menu Bar. 95 To enable, go to _System Preferences > Keyboard > Input Sources_, add _Unicode Hex Input_ to the list (it's under _Other_), then activate it from the input dropdown in the Menu Bar.
96 By default, this mode uses the left Option key (`KC_LALT`) for Unicode input, but this can be changed by defining [`UNICODE_KEY_OSX`](#input-key-configuration) with another keycode. 96 By default, this mode uses the left Option key (`KC_LALT`) for Unicode input, but this can be changed by defining [`UNICODE_KEY_MAC`](#input-key-configuration) with another keycode.
97 97
98 !> Using the _Unicode Hex Input_ input source may disable some Option based shortcuts, such as Option + Left Arrow and Option + Right Arrow. 98 !> Using the _Unicode Hex Input_ input source may disable some Option based shortcuts, such as Option + Left Arrow and Option + Right Arrow.
99 99
100 !> `UC_OSX` is a deprecated alias of `UC_MAC` that will be removed in a future version of QMK.
101
100* **`UC_LNX`**: Linux built-in IBus Unicode input. Supports code points up to `0x10FFFF` (all possible code points). 102* **`UC_LNX`**: Linux built-in IBus Unicode input. Supports code points up to `0x10FFFF` (all possible code points).
101 103
102 Enabled by default and works almost anywhere on IBus-enabled distros. Without IBus, this mode works under GTK apps, but rarely anywhere else. 104 Enabled by default and works almost anywhere on IBus-enabled distros. Without IBus, this mode works under GTK apps, but rarely anywhere else.
@@ -124,7 +126,7 @@ You can switch the input mode at any time by using one of the following keycodes
124|----------------------|---------|------------|--------------------------------------------------------------| 126|----------------------|---------|------------|--------------------------------------------------------------|
125|`UNICODE_MODE_FORWARD`|`UC_MOD` |Next in list|[Cycle](#input-mode-cycling) through selected modes | 127|`UNICODE_MODE_FORWARD`|`UC_MOD` |Next in list|[Cycle](#input-mode-cycling) through selected modes |
126|`UNICODE_MODE_REVERSE`|`UC_RMOD`|Prev in list|[Cycle](#input-mode-cycling) through selected modes in reverse| 128|`UNICODE_MODE_REVERSE`|`UC_RMOD`|Prev in list|[Cycle](#input-mode-cycling) through selected modes in reverse|
127|`UNICODE_MODE_OSX` |`UC_M_OS`|`UC_OSX` |Switch to macOS input | 129|`UNICODE_MODE_MAC` |`UC_M_MA`|`UC_MAC` |Switch to macOS input |
128|`UNICODE_MODE_LNX` |`UC_M_LN`|`UC_LNX` |Switch to Linux input | 130|`UNICODE_MODE_LNX` |`UC_M_LN`|`UC_LNX` |Switch to Linux input |
129|`UNICODE_MODE_WIN` |`UC_M_WI`|`UC_WIN` |Switch to Windows input | 131|`UNICODE_MODE_WIN` |`UC_M_WI`|`UC_WIN` |Switch to Windows input |
130|`UNICODE_MODE_BSD` |`UC_M_BS`|`UC_BSD` |Switch to BSD input (not implemented) | 132|`UNICODE_MODE_BSD` |`UC_M_BS`|`UC_BSD` |Switch to BSD input (not implemented) |
@@ -145,9 +147,9 @@ If you have the [Audio feature](feature_audio.md) enabled on the board, you can
145For instance, you can add these definitions to your `config.h` file: 147For instance, you can add these definitions to your `config.h` file:
146 148
147```c 149```c
148#define UNICODE_SONG_OSX COIN_SOUND 150#define UNICODE_SONG_MAC AUDIO_ON_SOUND
149#define UNICODE_SONG_LNX UNICODE_LINUX 151#define UNICODE_SONG_LNX UNICODE_LINUX
150#define UNICODE_SONG_BSD MARIO_GAMEOVER 152#define UNICODE_SONG_BSD TERMINAL_SOUND
151#define UNICODE_SONG_WIN UNICODE_WINDOWS 153#define UNICODE_SONG_WIN UNICODE_WINDOWS
152#define UNICODE_SONG_WINC UNICODE_WINDOWS 154#define UNICODE_SONG_WINC UNICODE_WINDOWS
153``` 155```
@@ -171,7 +173,7 @@ You can customize the keys used to trigger Unicode input for macOS, Linux and Wi
171 173
172|Define |Type |Default |Example | 174|Define |Type |Default |Example |
173|------------------|----------|------------------|-------------------------------------------| 175|------------------|----------|------------------|-------------------------------------------|
174|`UNICODE_KEY_OSX` |`uint8_t` |`KC_LALT` |`#define UNICODE_KEY_OSX KC_RALT` | 176|`UNICODE_KEY_MAC` |`uint8_t` |`KC_LALT` |`#define UNICODE_KEY_MAC KC_RALT` |
175|`UNICODE_KEY_LNX` |`uint16_t`|`LCTL(LSFT(KC_U))`|`#define UNICODE_KEY_LNX LCTL(LSFT(KC_E))`| 177|`UNICODE_KEY_LNX` |`uint16_t`|`LCTL(LSFT(KC_U))`|`#define UNICODE_KEY_LNX LCTL(LSFT(KC_E))`|
176|`UNICODE_KEY_WINC`|`uint8_t` |`KC_RALT` |`#define UNICODE_KEY_WINC KC_RGUI` | 178|`UNICODE_KEY_WINC`|`uint8_t` |`KC_RALT` |`#define UNICODE_KEY_WINC KC_RGUI` |
177 179
@@ -180,7 +182,7 @@ You can customize the keys used to trigger Unicode input for macOS, Linux and Wi
180You can choose which input modes are available for cycling through. By default, this is disabled. If you want to enable it, limiting it to just the modes you use makes sense. Note that the values in the list are comma-delimited. 182You can choose which input modes are available for cycling through. By default, this is disabled. If you want to enable it, limiting it to just the modes you use makes sense. Note that the values in the list are comma-delimited.
181 183
182```c 184```c
183#define UNICODE_SELECTED_MODES UC_OSX, UC_LNX, UC_WIN, UC_WINC 185#define UNICODE_SELECTED_MODES UC_MAC, UC_LNX, UC_WIN, UC_WINC
184``` 186```
185 187
186You can cycle through the selected modes by using the `UC_MOD`/`UC_RMOD` keycodes, or by calling `cycle_unicode_input_mode(offset)` in your code (`offset` is how many modes to move forward by, so +1 corresponds to `UC_MOD`). 188You can cycle through the selected modes by using the `UC_MOD`/`UC_RMOD` keycodes, or by calling `cycle_unicode_input_mode(offset)` in your code (`offset` is how many modes to move forward by, so +1 corresponds to `UC_MOD`).
diff --git a/docs/keycodes.md b/docs/keycodes.md
index 84da3d4c6..1a388f106 100644
--- a/docs/keycodes.md
+++ b/docs/keycodes.md
@@ -543,7 +543,7 @@ See also: [Unicode Support](feature_unicode.md)
543|`XP(i, j)` | |Send Unicode code point at index `i`, or `j` if Shift/Caps is on| 543|`XP(i, j)` | |Send Unicode code point at index `i`, or `j` if Shift/Caps is on|
544|`UNICODE_MODE_FORWARD`|`UC_MOD` |Cycle through selected input modes | 544|`UNICODE_MODE_FORWARD`|`UC_MOD` |Cycle through selected input modes |
545|`UNICODE_MODE_REVERSE`|`UC_RMOD`|Cycle through selected input modes in reverse | 545|`UNICODE_MODE_REVERSE`|`UC_RMOD`|Cycle through selected input modes in reverse |
546|`UNICODE_MODE_OSX` |`UC_M_OS`|Switch to macOS input | 546|`UNICODE_MODE_MAC` |`UC_M_MA`|Switch to macOS input |
547|`UNICODE_MODE_LNX` |`UC_M_LN`|Switch to Linux input | 547|`UNICODE_MODE_LNX` |`UC_M_LN`|Switch to Linux input |
548|`UNICODE_MODE_WIN` |`UC_M_WI`|Switch to Windows input | 548|`UNICODE_MODE_WIN` |`UC_M_WI`|Switch to Windows input |
549|`UNICODE_MODE_BSD` |`UC_M_BS`|Switch to BSD input (not implemented) | 549|`UNICODE_MODE_BSD` |`UC_M_BS`|Switch to BSD input (not implemented) |
diff --git a/keyboards/signum/3_0/elitec/keymaps/default/layout.py b/keyboards/signum/3_0/elitec/keymaps/default/layout.py
index ab9bce422..1e43e25c5 100644
--- a/keyboards/signum/3_0/elitec/keymaps/default/layout.py
+++ b/keyboards/signum/3_0/elitec/keymaps/default/layout.py
@@ -397,7 +397,7 @@ qmk_dict = {
397 "_sp_swp": "SHT(KC_SPC)", 397 "_sp_swp": "SHT(KC_SPC)",
398 # Unicode support (via X()) included implicitly 398 # Unicode support (via X()) included implicitly
399 # Switching Unicode Input Modes 399 # Switching Unicode Input Modes
400 "UC_win": "UC_M_WC", "UC_lnx": "UC_M_LN", "UC_osx": "UC_M_OS", 400 "UC_win": "UC_M_WC", "UC_lnx": "UC_M_LN", "UC_mac": "UC_M_MA",
401 401
402 # custom keys 402 # custom keys
403 "altF4": "LALT(KC_F4)", 403 "altF4": "LALT(KC_F4)",
diff --git a/quantum/process_keycode/process_unicode_common.c b/quantum/process_keycode/process_unicode_common.c
index fc392813a..48ce3961a 100644
--- a/quantum/process_keycode/process_unicode_common.c
+++ b/quantum/process_keycode/process_unicode_common.c
@@ -78,8 +78,8 @@ __attribute__((weak)) void unicode_input_start(void) {
78 clear_mods(); // Unregister mods to start from a clean state 78 clear_mods(); // Unregister mods to start from a clean state
79 79
80 switch (unicode_config.input_mode) { 80 switch (unicode_config.input_mode) {
81 case UC_OSX: 81 case UC_MAC:
82 register_code(UNICODE_KEY_OSX); 82 register_code(UNICODE_KEY_MAC);
83 break; 83 break;
84 case UC_LNX: 84 case UC_LNX:
85 tap_code16(UNICODE_KEY_LNX); 85 tap_code16(UNICODE_KEY_LNX);
@@ -99,8 +99,8 @@ __attribute__((weak)) void unicode_input_start(void) {
99 99
100__attribute__((weak)) void unicode_input_finish(void) { 100__attribute__((weak)) void unicode_input_finish(void) {
101 switch (unicode_config.input_mode) { 101 switch (unicode_config.input_mode) {
102 case UC_OSX: 102 case UC_MAC:
103 unregister_code(UNICODE_KEY_OSX); 103 unregister_code(UNICODE_KEY_MAC);
104 break; 104 break;
105 case UC_LNX: 105 case UC_LNX:
106 tap_code(KC_SPC); 106 tap_code(KC_SPC);
@@ -118,8 +118,8 @@ __attribute__((weak)) void unicode_input_finish(void) {
118 118
119__attribute__((weak)) void unicode_input_cancel(void) { 119__attribute__((weak)) void unicode_input_cancel(void) {
120 switch (unicode_config.input_mode) { 120 switch (unicode_config.input_mode) {
121 case UC_OSX: 121 case UC_MAC:
122 unregister_code(UNICODE_KEY_OSX); 122 unregister_code(UNICODE_KEY_MAC);
123 break; 123 break;
124 case UC_LNX: 124 case UC_LNX:
125 case UC_WINC: 125 case UC_WINC:
@@ -253,11 +253,11 @@ bool process_unicode_common(uint16_t keycode, keyrecord_t *record) {
253 cycle_unicode_input_mode(-1); 253 cycle_unicode_input_mode(-1);
254 break; 254 break;
255 255
256 case UNICODE_MODE_OSX: 256 case UNICODE_MODE_MAC:
257 set_unicode_input_mode(UC_OSX); 257 set_unicode_input_mode(UC_MAC);
258#if defined(AUDIO_ENABLE) && defined(UNICODE_SONG_OSX) 258#if defined(AUDIO_ENABLE) && defined(UNICODE_SONG_MAC)
259 static float song_osx[][2] = UNICODE_SONG_OSX; 259 static float song_mac[][2] = UNICODE_SONG_MAC;
260 PLAY_SONG(song_osx); 260 PLAY_SONG(song_mac);
261#endif 261#endif
262 break; 262 break;
263 case UNICODE_MODE_LNX: 263 case UNICODE_MODE_LNX:
diff --git a/quantum/process_keycode/process_unicode_common.h b/quantum/process_keycode/process_unicode_common.h
index 13b6431bf..5421c28c7 100644
--- a/quantum/process_keycode/process_unicode_common.h
+++ b/quantum/process_keycode/process_unicode_common.h
@@ -23,8 +23,8 @@
23#endif 23#endif
24 24
25// Keycodes used for starting Unicode input on different platforms 25// Keycodes used for starting Unicode input on different platforms
26#ifndef UNICODE_KEY_OSX 26#ifndef UNICODE_KEY_MAC
27# define UNICODE_KEY_OSX KC_LALT 27# define UNICODE_KEY_MAC KC_LALT
28#endif 28#endif
29#ifndef UNICODE_KEY_LNX 29#ifndef UNICODE_KEY_LNX
30# define UNICODE_KEY_LNX LCTL(LSFT(KC_U)) 30# define UNICODE_KEY_LNX LCTL(LSFT(KC_U))
@@ -49,8 +49,17 @@
49# define UNICODE_TYPE_DELAY 10 49# define UNICODE_TYPE_DELAY 10
50#endif 50#endif
51 51
52// Deprecated aliases
53#if !defined(UNICODE_KEY_MAC) && defined(UNICODE_KEY_OSX)
54# define UNICODE_KEY_MAC UNICODE_KEY_OSX
55#endif
56#if !defined(UNICODE_SONG_MAC) && defined(UNICODE_SONG_OSX)
57# define UNICODE_SONG_MAC UNICODE_SONG_OSX
58#endif
59#define UC_OSX UC_MAC
60
52enum unicode_input_modes { 61enum unicode_input_modes {
53 UC_OSX, // Mac OS X using Unicode Hex Input 62 UC_MAC, // macOS using Unicode Hex Input
54 UC_LNX, // Linux using IBus 63 UC_LNX, // Linux using IBus
55 UC_WIN, // Windows using EnableHexNumpad 64 UC_WIN, // Windows using EnableHexNumpad
56 UC_BSD, // BSD (not implemented) 65 UC_BSD, // BSD (not implemented)
diff --git a/quantum/process_keycode/process_unicodemap.c b/quantum/process_keycode/process_unicodemap.c
index 1be51a995..5445cde12 100644
--- a/quantum/process_keycode/process_unicodemap.c
+++ b/quantum/process_keycode/process_unicodemap.c
@@ -43,7 +43,7 @@ bool process_unicodemap(uint16_t keycode, keyrecord_t *record) {
43 if (code > 0x10FFFF || (code > 0xFFFF && input_mode == UC_WIN)) { 43 if (code > 0x10FFFF || (code > 0xFFFF && input_mode == UC_WIN)) {
44 // Character is out of range supported by the platform 44 // Character is out of range supported by the platform
45 unicode_input_cancel(); 45 unicode_input_cancel();
46 } else if (code > 0xFFFF && input_mode == UC_OSX) { 46 } else if (code > 0xFFFF && input_mode == UC_MAC) {
47 // Convert to UTF-16 surrogate pair on Mac 47 // Convert to UTF-16 surrogate pair on Mac
48 code -= 0x10000; 48 code -= 0x10000;
49 uint32_t lo = code & 0x3FF, hi = (code & 0xFFC00) >> 10; 49 uint32_t lo = code & 0x3FF, hi = (code & 0xFFC00) >> 10;
diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h
index 54428fe1f..f6aac2234 100644
--- a/quantum/quantum_keycodes.h
+++ b/quantum/quantum_keycodes.h
@@ -459,7 +459,7 @@ enum quantum_keycodes {
459 459
460 UNICODE_MODE_FORWARD, 460 UNICODE_MODE_FORWARD,
461 UNICODE_MODE_REVERSE, 461 UNICODE_MODE_REVERSE,
462 UNICODE_MODE_OSX, 462 UNICODE_MODE_MAC,
463 UNICODE_MODE_LNX, 463 UNICODE_MODE_LNX,
464 UNICODE_MODE_WIN, 464 UNICODE_MODE_WIN,
465 UNICODE_MODE_BSD, 465 UNICODE_MODE_BSD,
@@ -777,7 +777,9 @@ enum quantum_keycodes {
777#define UC_MOD UNICODE_MODE_FORWARD 777#define UC_MOD UNICODE_MODE_FORWARD
778#define UC_RMOD UNICODE_MODE_REVERSE 778#define UC_RMOD UNICODE_MODE_REVERSE
779 779
780#define UC_M_OS UNICODE_MODE_OSX 780#define UC_M_MA UNICODE_MODE_MAC
781#define UNICODE_MODE_OSX UNICODE_MODE_MAC // Deprecated alias
782#define UC_M_OS UNICODE_MODE_MAC // Deprecated alias
781#define UC_M_LN UNICODE_MODE_LNX 783#define UC_M_LN UNICODE_MODE_LNX
782#define UC_M_WI UNICODE_MODE_WIN 784#define UC_M_WI UNICODE_MODE_WIN
783#define UC_M_BS UNICODE_MODE_BSD 785#define UC_M_BS UNICODE_MODE_BSD
diff --git a/users/drashna/config.h b/users/drashna/config.h
index 6fafff860..106ae19c1 100644
--- a/users/drashna/config.h
+++ b/users/drashna/config.h
@@ -21,7 +21,7 @@
21 21
22# define AUDIO_CLICKY_FREQ_RANDOMNESS 1.5f 22# define AUDIO_CLICKY_FREQ_RANDOMNESS 1.5f
23 23
24# define UNICODE_SONG_OSX SONG(RICK_ROLL) 24# define UNICODE_SONG_MAC SONG(RICK_ROLL)
25# define UNICODE_SONG_LNX SONG(RICK_ROLL) 25# define UNICODE_SONG_LNX SONG(RICK_ROLL)
26# define UNICODE_SONG_WIN SONG(RICK_ROLL) 26# define UNICODE_SONG_WIN SONG(RICK_ROLL)
27# define UNICODE_SONG_BSD SONG(RICK_ROLL) 27# define UNICODE_SONG_BSD SONG(RICK_ROLL)
diff --git a/users/kuchosauronad0/config.h b/users/kuchosauronad0/config.h
index b06c9e2c5..58542dc18 100644
--- a/users/kuchosauronad0/config.h
+++ b/users/kuchosauronad0/config.h
@@ -11,7 +11,7 @@
11# undef NOTE_REST 11# undef NOTE_REST
12# define NOTE_REST 1.00f 12# define NOTE_REST 1.00f
13# endif // !__arm__ 13# endif // !__arm__
14# define UNICODE_SONG_OSX SONG(RICK_ROLL) 14# define UNICODE_SONG_MAC SONG(RICK_ROLL)
15# define UNICODE_SONG_LNX SONG(RICK_ROLL) 15# define UNICODE_SONG_LNX SONG(RICK_ROLL)
16# define UNICODE_SONG_WIN SONG(RICK_ROLL) 16# define UNICODE_SONG_WIN SONG(RICK_ROLL)
17# define UNICODE_SONG_BSD SONG(RICK_ROLL) 17# define UNICODE_SONG_BSD SONG(RICK_ROLL)