Skip to content

Commit

Permalink
Apple Globe Support
Browse files Browse the repository at this point in the history
  • Loading branch information
drashna committed Dec 1, 2024
1 parent 99d587b commit 5681f79
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions data/constants/keycodes/keycodes_0.0.7.hjson
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
12 changes: 12 additions & 0 deletions data/constants/keycodes/keycodes_0.0.7_basic.hjson
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"keycodes": {
"0x00C3": {
"group": "media",
"key": "KC_GLOBE",
"label": "Apple Globe/Fn",
"aliases": [
"KC_GLB"
]
}
}
}
6 changes: 4 additions & 2 deletions quantum/keycodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ enum qk_keycode_defines {
KC_ASSISTANT = 0x00C0,
KC_MISSION_CONTROL = 0x00C1,
KC_LAUNCHPAD = 0x00C2,
KC_GLOBE = 0x00C3,
QK_MOUSE_CURSOR_UP = 0x00CD,
QK_MOUSE_CURSOR_DOWN = 0x00CE,
QK_MOUSE_CURSOR_LEFT = 0x00CF,
Expand Down Expand Up @@ -952,6 +953,7 @@ enum qk_keycode_defines {
KC_ASST = KC_ASSISTANT,
KC_MCTL = KC_MISSION_CONTROL,
KC_LPAD = KC_LAUNCHPAD,
KC_GLB = KC_GLOBE,
MS_UP = QK_MOUSE_CURSOR_UP,
MS_DOWN = QK_MOUSE_CURSOR_DOWN,
MS_LEFT = QK_MOUSE_CURSOR_LEFT,
Expand Down Expand Up @@ -1503,7 +1505,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) >= QK_MOUSE_CURSOR_UP && (code) <= QK_MOUSE_ACCELERATION_2)
#define IS_MODIFIER_KEYCODE(code) ((code) >= KC_LEFT_CTRL && (code) <= KC_RIGHT_GUI)
#define IS_POINTING_MODE_UTIL_KEYCODE(code) ((code) >= QK_PM_CYCLE_DEVICES && (code) <= QK_PM_DEVICE_LEFT)
Expand All @@ -1530,7 +1532,7 @@ enum qk_keycode_defines {
#define INTERNAL_KEYCODE_RANGE KC_NO ... KC_TRANSPARENT
#define BASIC_KEYCODE_RANGE KC_A ... KC_EXSEL
#define SYSTEM_KEYCODE_RANGE KC_SYSTEM_POWER ... KC_SYSTEM_WAKE
#define CONSUMER_KEYCODE_RANGE KC_AUDIO_MUTE ... KC_LAUNCHPAD
#define CONSUMER_KEYCODE_RANGE KC_AUDIO_MUTE ... KC_GLOBE
#define MOUSE_KEYCODE_RANGE QK_MOUSE_CURSOR_UP ... QK_MOUSE_ACCELERATION_2
#define MODIFIER_KEYCODE_RANGE KC_LEFT_CTRL ... KC_RIGHT_GUI
#define POINTING_MODE_UTIL_KEYCODE_RANGE QK_PM_CYCLE_DEVICES ... QK_PM_DEVICE_LEFT
Expand Down
1 change: 1 addition & 0 deletions tests/test_common/keycode_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ std::map<uint16_t, std::string> KEYCODE_ID_TABLE = {
{KC_ASSISTANT, "KC_ASSISTANT"},
{KC_MISSION_CONTROL, "KC_MISSION_CONTROL"},
{KC_LAUNCHPAD, "KC_LAUNCHPAD"},
{KC_GLOBE, "KC_GLOBE"},
{QK_MOUSE_CURSOR_UP, "QK_MOUSE_CURSOR_UP"},
{QK_MOUSE_CURSOR_DOWN, "QK_MOUSE_CURSOR_DOWN"},
{QK_MOUSE_CURSOR_LEFT, "QK_MOUSE_CURSOR_LEFT"},
Expand Down
2 changes: 2 additions & 0 deletions tmk_core/protocol/report.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ static inline uint16_t KEYCODE2CONSUMER(uint8_t key) {
return AC_DESKTOP_SHOW_ALL_WINDOWS;
case KC_LAUNCHPAD:
return AC_SOFT_KEY_LEFT;
case KC_GLOBE:
return AC_NEXT_KEYBOARD_LAYOUT_SELECT;
default:
return 0;
}
Expand Down

0 comments on commit 5681f79

Please sign in to comment.