diff --git a/data/constants/keycodes/keycodes_0.0.4.hjson b/data/constants/keycodes/keycodes_0.0.4.hjson new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/data/constants/keycodes/keycodes_0.0.4_basic.hjson b/data/constants/keycodes/keycodes_0.0.4_basic.hjson new file mode 100644 index 000000000000..5263daf28322 --- /dev/null +++ b/data/constants/keycodes/keycodes_0.0.4_basic.hjson @@ -0,0 +1,12 @@ +{ + "keycodes": { + "0x00C3": { + "group": "media", + "key": "KC_GLOBE", + "label": "Apple Globe/FN Key", + "aliases": [ + "KC_GLB" + ] + } + } +} diff --git a/quantum/keycodes.h b/quantum/keycodes.h index bbf10da36d97..06e665d94321 100644 --- a/quantum/keycodes.h +++ b/quantum/keycodes.h @@ -283,6 +283,7 @@ enum qk_keycode_defines { KC_ASSISTANT = 0x00C0, KC_MISSION_CONTROL = 0x00C1, KC_LAUNCHPAD = 0x00C2, + KC_GLOBE = 0x00C3, KC_MS_UP = 0x00CD, KC_MS_DOWN = 0x00CE, KC_MS_LEFT = 0x00CF, @@ -904,6 +905,7 @@ enum qk_keycode_defines { KC_ASST = KC_ASSISTANT, KC_MCTL = KC_MISSION_CONTROL, KC_LPAD = KC_LAUNCHPAD, + KC_GLB = KC_GLOBE, KC_MS_U = KC_MS_UP, KC_MS_D = KC_MS_DOWN, KC_MS_L = KC_MS_LEFT, @@ -1403,7 +1405,7 @@ enum qk_keycode_defines { #define IS_INTERNAL_KEYCODE(code) ((code) >= KC_NO && (code) <= KC_TRANSPARENT) #define IS_BASIC_KEYCODE(code) ((code) >= KC_A && (code) <= KC_EXSEL) #define IS_SYSTEM_KEYCODE(code) ((code) >= KC_SYSTEM_POWER && (code) <= KC_SYSTEM_WAKE) -#define IS_CONSUMER_KEYCODE(code) ((code) >= KC_AUDIO_MUTE && (code) <= KC_LAUNCHPAD) +#define IS_CONSUMER_KEYCODE(code) ((code) >= KC_AUDIO_MUTE && (code) <= KC_GLOBE) #define IS_MOUSE_KEYCODE(code) ((code) >= KC_MS_UP && (code) <= KC_MS_ACCEL2) #define IS_MODIFIER_KEYCODE(code) ((code) >= KC_LEFT_CTRL && (code) <= KC_RIGHT_GUI) #define IS_SWAP_HANDS_KEYCODE(code) ((code) >= QK_SWAP_HANDS_TOGGLE && (code) <= QK_SWAP_HANDS_ONE_SHOT) diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c index 9a67fad278c2..92f835e4fecb 100644 --- a/quantum/keymap_common.c +++ b/quantum/keymap_common.c @@ -67,7 +67,7 @@ action_t action_for_keycode(uint16_t keycode) { case KC_SYSTEM_POWER ... KC_SYSTEM_WAKE: action.code = ACTION_USAGE_SYSTEM(KEYCODE2SYSTEM(keycode)); break; - case KC_AUDIO_MUTE ... KC_LAUNCHPAD: + case KC_AUDIO_MUTE ... KC_GLOBE: action.code = ACTION_USAGE_CONSUMER(KEYCODE2CONSUMER(keycode)); break; #endif diff --git a/tests/test_common/keycode_table.cpp b/tests/test_common/keycode_table.cpp index 9ed80cdbcf66..256e01b0234d 100644 --- a/tests/test_common/keycode_table.cpp +++ b/tests/test_common/keycode_table.cpp @@ -225,6 +225,7 @@ std::map KEYCODE_ID_TABLE = { {KC_ASSISTANT, "KC_ASSISTANT"}, {KC_MISSION_CONTROL, "KC_MISSION_CONTROL"}, {KC_LAUNCHPAD, "KC_LAUNCHPAD"}, + {KC_GLOBE, "KC_GLOBE"}, {KC_MS_UP, "KC_MS_UP"}, {KC_MS_DOWN, "KC_MS_DOWN"}, {KC_MS_LEFT, "KC_MS_LEFT"}, diff --git a/tmk_core/protocol/report.h b/tmk_core/protocol/report.h index 9d415a3bfd7c..3cd553903925 100644 --- a/tmk_core/protocol/report.h +++ b/tmk_core/protocol/report.h @@ -104,6 +104,7 @@ enum consumer_usages { AC_STOP = 0x226, AC_REFRESH = 0x227, AC_BOOKMARKS = 0x22A, + AC_GLOBE = 0x29D, AC_MISSION_CONTROL = 0x29F, AC_LAUNCHPAD = 0x2A0 }; @@ -324,6 +325,8 @@ static inline uint16_t KEYCODE2CONSUMER(uint8_t key) { return AC_MISSION_CONTROL; case KC_LAUNCHPAD: return AC_LAUNCHPAD; + case KC_GLOBE: + return AC_GLOBE; default: return 0; }