summaryrefslogtreecommitdiff
path: root/quantum/process_keycode
diff options
context:
space:
mode:
authorKonstantin Đorđević <vomindoraan@gmail.com>2020-03-31 18:28:43 +0200
committerGitHub <noreply@github.com>2020-03-31 18:28:43 +0200
commitbdfdc506da7702960bf3f6167a3a95f1230b0397 (patch)
tree7ff6d48d076fd04e55cb54320cc504d393985d80 /quantum/process_keycode
parent51a81813b0191d95f3ed774cbc410579e606dc5c (diff)
Rename UC_OSX (and related constants) to UC_MAC (#8589)
* Rename UC_OSX (and related constants) to UC_MAC * Update UNICODE_SONG_OSX references to UNICODE_SONG_MAC * Update UC_M_OS references to UC_M_MA * Add UC_OSX alias for backwards compatibility * Add deprecation warning for UC_OSX to Unicode docs * Add UC_M_OS alias for backwards compatibility * Update newly found UC_M_OS and UNICODE_SONG_OSX references * Add legacy UNICODE_MODE_OSX alias, revert changes to user keymaps * Add legacy UNICODE_SONG_OSX alias, revert changes to user keymaps * Replace removed sounds in Unicode song doc examples
Diffstat (limited to 'quantum/process_keycode')
-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
3 files changed, 24 insertions, 15 deletions
diff --git a/quantum/process_keycode/process_unicode_common.c b/quantum/process_keycode/process_unicode_common.c
index fc392813ae..48ce3961ad 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) {
clear_mods(); // Unregister mods to start from a clean state
switch (unicode_config.input_mode) {
- case UC_OSX:
- register_code(UNICODE_KEY_OSX);
+ case UC_MAC:
+ register_code(UNICODE_KEY_MAC);
break;
case UC_LNX:
tap_code16(UNICODE_KEY_LNX);
@@ -99,8 +99,8 @@ __attribute__((weak)) void unicode_input_start(void) {
__attribute__((weak)) void unicode_input_finish(void) {
switch (unicode_config.input_mode) {
- case UC_OSX:
- unregister_code(UNICODE_KEY_OSX);
+ case UC_MAC:
+ unregister_code(UNICODE_KEY_MAC);
break;
case UC_LNX:
tap_code(KC_SPC);
@@ -118,8 +118,8 @@ __attribute__((weak)) void unicode_input_finish(void) {
__attribute__((weak)) void unicode_input_cancel(void) {
switch (unicode_config.input_mode) {
- case UC_OSX:
- unregister_code(UNICODE_KEY_OSX);
+ case UC_MAC:
+ unregister_code(UNICODE_KEY_MAC);
break;
case UC_LNX:
case UC_WINC:
@@ -253,11 +253,11 @@ bool process_unicode_common(uint16_t keycode, keyrecord_t *record) {
cycle_unicode_input_mode(-1);
break;
- case UNICODE_MODE_OSX:
- set_unicode_input_mode(UC_OSX);
-#if defined(AUDIO_ENABLE) && defined(UNICODE_SONG_OSX)
- static float song_osx[][2] = UNICODE_SONG_OSX;
- PLAY_SONG(song_osx);
+ case UNICODE_MODE_MAC:
+ set_unicode_input_mode(UC_MAC);
+#if defined(AUDIO_ENABLE) && defined(UNICODE_SONG_MAC)
+ static float song_mac[][2] = UNICODE_SONG_MAC;
+ PLAY_SONG(song_mac);
#endif
break;
case UNICODE_MODE_LNX:
diff --git a/quantum/process_keycode/process_unicode_common.h b/quantum/process_keycode/process_unicode_common.h
index 13b6431bf0..5421c28c7f 100644
--- a/quantum/process_keycode/process_unicode_common.h
+++ b/quantum/process_keycode/process_unicode_common.h
@@ -23,8 +23,8 @@
#endif
// Keycodes used for starting Unicode input on different platforms
-#ifndef UNICODE_KEY_OSX
-# define UNICODE_KEY_OSX KC_LALT
+#ifndef UNICODE_KEY_MAC
+# define UNICODE_KEY_MAC KC_LALT
#endif
#ifndef UNICODE_KEY_LNX
# define UNICODE_KEY_LNX LCTL(LSFT(KC_U))
@@ -49,8 +49,17 @@
# define UNICODE_TYPE_DELAY 10
#endif
+// Deprecated aliases
+#if !defined(UNICODE_KEY_MAC) && defined(UNICODE_KEY_OSX)
+# define UNICODE_KEY_MAC UNICODE_KEY_OSX
+#endif
+#if !defined(UNICODE_SONG_MAC) && defined(UNICODE_SONG_OSX)
+# define UNICODE_SONG_MAC UNICODE_SONG_OSX
+#endif
+#define UC_OSX UC_MAC
+
enum unicode_input_modes {
- UC_OSX, // Mac OS X using Unicode Hex Input
+ UC_MAC, // macOS using Unicode Hex Input
UC_LNX, // Linux using IBus
UC_WIN, // Windows using EnableHexNumpad
UC_BSD, // BSD (not implemented)
diff --git a/quantum/process_keycode/process_unicodemap.c b/quantum/process_keycode/process_unicodemap.c
index 1be51a995c..5445cde129 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) {
if (code > 0x10FFFF || (code > 0xFFFF && input_mode == UC_WIN)) {
// Character is out of range supported by the platform
unicode_input_cancel();
- } else if (code > 0xFFFF && input_mode == UC_OSX) {
+ } else if (code > 0xFFFF && input_mode == UC_MAC) {
// Convert to UTF-16 surrogate pair on Mac
code -= 0x10000;
uint32_t lo = code & 0x3FF, hi = (code & 0xFFC00) >> 10;