From 2ffdec5dc2a5cb350998168e76d7916e2d9728fc Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Fri, 10 Feb 2023 21:08:54 +0000 Subject: [PATCH] Move more unicode ranges to DD (#19755) --- data/constants/keycodes/keycodes_0.0.2.hjson | 11 ++++++++++- quantum/keycodes.h | 6 ++++++ quantum/quantum_keycodes.h | 4 ---- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/data/constants/keycodes/keycodes_0.0.2.hjson b/data/constants/keycodes/keycodes_0.0.2.hjson index 0967ef424b..650235e647 100644 --- a/data/constants/keycodes/keycodes_0.0.2.hjson +++ b/data/constants/keycodes/keycodes_0.0.2.hjson @@ -1 +1,10 @@ -{} +{ + "ranges": { + "0x8000/0X3FFF": { + "define": "QK_UNICODEMAP" + }, + "0xC000/0X3FFF": { + "define": "QK_UNICODEMAP_PAIR" + } + } +} diff --git a/quantum/keycodes.h b/quantum/keycodes.h index eafa9eb1b6..96f352a2c1 100644 --- a/quantum/keycodes.h +++ b/quantum/keycodes.h @@ -82,6 +82,10 @@ enum qk_keycode_ranges { QK_USER_MAX = 0x7FFF, QK_UNICODE = 0x8000, QK_UNICODE_MAX = 0xFFFF, + QK_UNICODEMAP = 0x8000, + QK_UNICODEMAP_MAX = 0xBFFF, + QK_UNICODEMAP_PAIR = 0xC000, + QK_UNICODEMAP_PAIR_MAX = 0xFFFF, }; enum qk_keycode_defines { @@ -1308,6 +1312,8 @@ enum qk_keycode_defines { #define IS_QK_KB(code) ((code) >= QK_KB && (code) <= QK_KB_MAX) #define IS_QK_USER(code) ((code) >= QK_USER && (code) <= QK_USER_MAX) #define IS_QK_UNICODE(code) ((code) >= QK_UNICODE && (code) <= QK_UNICODE_MAX) +#define IS_QK_UNICODEMAP(code) ((code) >= QK_UNICODEMAP && (code) <= QK_UNICODEMAP_MAX) +#define IS_QK_UNICODEMAP_PAIR(code) ((code) >= QK_UNICODEMAP_PAIR && (code) <= QK_UNICODEMAP_PAIR_MAX) // Group Helpers #define IS_INTERNAL_KEYCODE(code) ((code) >= KC_NO && (code) <= KC_TRANSPARENT) diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index 688fb892eb..9933d5c989 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -33,10 +33,6 @@ #define QK_RSFT 0x1200 #define QK_RALT 0x1400 #define QK_RGUI 0x1800 -#define QK_UNICODEMAP 0x8000 -#define QK_UNICODEMAP_MAX 0xBFFF -#define QK_UNICODEMAP_PAIR 0xC000 -#define QK_UNICODEMAP_PAIR_MAX 0xFFFF // clang-format on // Generic decoding for the whole QK_MODS range