diff --git a/data/constants/keycodes/keycodes_0.0.7.hjson b/data/constants/keycodes/keycodes_0.0.7.hjson new file mode 100644 index 000000000000..0967ef424bce --- /dev/null +++ b/data/constants/keycodes/keycodes_0.0.7.hjson @@ -0,0 +1 @@ +{} diff --git a/data/constants/keycodes/keycodes_0.0.7_basic.hjson b/data/constants/keycodes/keycodes_0.0.7_basic.hjson new file mode 100644 index 000000000000..d174aaf7774a --- /dev/null +++ b/data/constants/keycodes/keycodes_0.0.7_basic.hjson @@ -0,0 +1,12 @@ +{ + "keycodes": { + "0x00C3": { + "group": "media", + "key": "KC_GLOBE", + "label": "Apple Globe/Fn", + "aliases": [ + "KC_GLB" + ] + } + } +} diff --git a/docs/keycodes.md b/docs/keycodes.md index cf170721c814..7aef239550ae 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -211,6 +211,7 @@ See also: [Basic Keycodes](keycodes_basic) |`KC_ASSISTANT` |`KC_ASST` |Launch Context-Aware Assistant |✔ | | | |`KC_MISSION_CONTROL` |`KC_MCTL` |Open Mission Control | |✔ | | |`KC_LAUNCHPAD` |`KC_LPAD` |Open Launchpad | |✔ | | +|`KC_GLOBE` |`KC_GLB` |Apple Globe/Fn | |✔7| | 1. The Linux kernel HID driver recognizes [nearly all keycodes](https://github.com/torvalds/linux/blob/master/drivers/hid/hid-input.c), but the default bindings depend on the DE/WM.
2. Treated as F13-F15.
@@ -218,6 +219,7 @@ See also: [Basic Keycodes](keycodes_basic) 4. Holding Shift+Option allows for finer control of volume level.
5. Skips the entire track in iTunes when tapped, seeks within the current track when held.
6. WMP does not recognize the Rewind key, but both alter playback speed in VLC. +7. Requires `KEYBOARD_SHARED_EP = yes` in `rules.mk` or `usb.shared_endpoint.keyboard=true` in `keyboard.json`. Globe+F-keys/arrow keys do not work. ## Quantum Keycodes {#quantum-keycodes} diff --git a/docs/keycodes_basic.md b/docs/keycodes_basic.md index 6ff422f89b14..3838294e17b3 100644 --- a/docs/keycodes_basic.md +++ b/docs/keycodes_basic.md @@ -227,6 +227,7 @@ Some of these keycodes may behave differently depending on the OS. For example, |`KC_ASSISTANT` |`KC_ASST`|Launch Assistant | |`KC_MISSION_CONTROL` |`KC_MCTL`|Open Mission Control| |`KC_LAUNCHPAD` |`KC_LPAD`|Open Launchpad | +|`KC_GLOBE` |`KC_GLB` |Apple Globe/Fn | ## Number Pad diff --git a/quantum/keycodes.h b/quantum/keycodes.h index 921dc7199f26..b42637b94b94 100644 --- a/quantum/keycodes.h +++ b/quantum/keycodes.h @@ -287,6 +287,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, @@ -943,6 +944,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, @@ -1488,7 +1490,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_SWAP_HANDS_KEYCODE(code) ((code) >= QK_SWAP_HANDS_TOGGLE && (code) <= QK_SWAP_HANDS_ONE_SHOT) @@ -1514,7 +1516,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 SWAP_HANDS_KEYCODE_RANGE QK_SWAP_HANDS_TOGGLE ... QK_SWAP_HANDS_ONE_SHOT diff --git a/tests/test_common/keycode_table.cpp b/tests/test_common/keycode_table.cpp index ae1a9edcd0fc..01cfa549bb07 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"}, {QK_MOUSE_CURSOR_UP, "QK_MOUSE_CURSOR_UP"}, {QK_MOUSE_CURSOR_DOWN, "QK_MOUSE_CURSOR_DOWN"}, {QK_MOUSE_CURSOR_LEFT, "QK_MOUSE_CURSOR_LEFT"}, diff --git a/tmk_core/protocol/report.h b/tmk_core/protocol/report.h index d854f51d5c45..8b7bfd375a84 100644 --- a/tmk_core/protocol/report.h +++ b/tmk_core/protocol/report.h @@ -29,7 +29,7 @@ along with this program. If not, see . // clang-format off /* HID report IDs */ -enum hid_report_ids { +enum hid_report_ids { REPORT_ID_ALL = 0, REPORT_ID_KEYBOARD = 1, REPORT_ID_MOUSE, @@ -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; }