Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addition to the Apple Globe key code to QMK #24661

Open
wants to merge 27 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e1db7e4
Added a default firmware and layout for the WindStudio Wind X R1
ChrisGVE Nov 5, 2024
084a28b
Wind X R1: cleaned-up the folders to make clear that this firmware is
ChrisGVE Nov 5, 2024
43ca630
Merge branch 'qmk:master' into master
ChrisGVE Nov 7, 2024
df21f6d
Merge branch 'qmk:master' into master
ChrisGVE Nov 8, 2024
2859d3d
Delete keyboards/windstudio/wind_x/R1 directory
ChrisGVE Nov 8, 2024
b7422ca
Merge branch 'qmk:master' into master
ChrisGVE Nov 9, 2024
e4541bf
Merge branch 'qmk:master' into main
ChrisGVE Nov 12, 2024
1d5571e
Merge branch 'qmk:master' into main
ChrisGVE Nov 16, 2024
02b20f0
Merge branch 'qmk:master' into main
ChrisGVE Nov 17, 2024
74bef5b
feat(core): add KC_GLOBE keycodes according
ChrisGVE Nov 17, 2024
20cc8b0
fix(core): fix the previous commit for the KC_GLOBE key
ChrisGVE Nov 17, 2024
84d49f6
Merge branch 'qmk:master' into apple
ChrisGVE Nov 23, 2024
bcc0cf9
Merge branch 'qmk:master' into apple
ChrisGVE Nov 29, 2024
c769c2c
Merge branch 'qmk:master' into apple
ChrisGVE Nov 30, 2024
1fd2c0d
feat(globe): added a switch to enable the Globe key
ChrisGVE Nov 30, 2024
061bbb5
docs(globe): added the Globe key to the QMK documentation
ChrisGVE Nov 30, 2024
66c7638
docs(globe key): Updated the .md file to prevent too much churn
ChrisGVE Nov 30, 2024
179fda2
chore(globe key): added keycodes_0.0.7, ran ./util/regen.sh
ChrisGVE Nov 30, 2024
90204f7
fix(keycodes.md): an end tag was missing
ChrisGVE Nov 30, 2024
0027d4b
chore(globe): removing unrelated files
ChrisGVE Nov 30, 2024
ad15e33
Update tmk_core/protocol.mk
ChrisGVE Nov 30, 2024
559cd8c
fix(globe key): corrected the flag set.
ChrisGVE Nov 30, 2024
9fed162
Update data/constants/keycodes/keycodes_0.0.7_basic.hjson
ChrisGVE Nov 30, 2024
39ffd47
Update docs/keycodes.md
ChrisGVE Nov 30, 2024
a80f527
Update docs/keycodes_basic.md
ChrisGVE Nov 30, 2024
fad7f83
Update docs/keycodes.md
ChrisGVE Dec 1, 2024
3ca8651
Update tmk_core/protocol.mk
ChrisGVE Dec 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 Key",
ChrisGVE marked this conversation as resolved.
Show resolved Hide resolved
"aliases": [
"KC_GLB"
]
}
}
}
3 changes: 2 additions & 1 deletion docs/keycodes.md
ChrisGVE marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,14 @@ 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 Key | |✔<sup>7</sup>| |
ChrisGVE marked this conversation as resolved.
Show resolved Hide resolved
<sup>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.</sup><br/>
<sup>2. Treated as F13-F15.</sup><br/>
<sup>3. Must be held for about three seconds, and will display a prompt instead.</sup><br/>
<sup>4. Holding Shift+Option allows for finer control of volume level.</sup><br/>
<sup>5. Skips the entire track in iTunes when tapped, seeks within the current track when held.</sup><br/>
<sup>6. WMP does not recognize the Rewind key, but both alter playback speed in VLC.</sup>
<sup>7. The Globe key requires `GLOBE_KEY_ENABLE = yes` to be set in `rules.mk`. When pressed it will reveal the emoji picker, and it can be combined with other keys. Note however that Globe+F-keys or Globe+arrow do not work.</sup>
ChrisGVE marked this conversation as resolved.
Show resolved Hide resolved

## Quantum Keycodes {#quantum-keycodes}

Expand Down
1 change: 1 addition & 0 deletions docs/keycodes_basic.md
ChrisGVE marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -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 Key |
ChrisGVE marked this conversation as resolved.
Show resolved Hide resolved

## Number Pad

Expand Down
57 changes: 57 additions & 0 deletions keyboards/zlant_xl/config.h.old
ChrisGVE marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/* Copyright 2021 Christian C. Berclaz
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include QMK_KEYBOARD_H

/* key matrix size */
// #define MATRIX_ROWS 10
// #define MATRIX_COLS 6

/*
* Keyboard Matrix Assignments
*
* Change this to how you wired your keyboard
* COLS: AVR pins used for columns, left to right
* ROWS: AVR pins used for rows, top to bottom
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
*
*/
#define WS2812_DI_PIN C2
#ifdef WS2812_DI_PIN
# define RGBLED_NUM 12
# define RGBLIGHT_HUE_STEP 8
// # define RGBLIGHT_SAT_STEP 8
// # define RGBLIGHT_VAL_STEP 8
# define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
/*== all animations enable ==*/
# define RGBLIGHT_ANIMATIONS
/*== or choose animations ==*/
# define RGBLIGHT_EFFECT_BREATHING
# define RGBLIGHT_EFFECT_RAINBOW_MOOD
# define RGBLIGHT_EFFECT_RAINBOW_SWIRL
# define RGBLIGHT_EFFECT_SNAKE
# define RGBLIGHT_EFFECT_KNIGHT
# define RGBLIGHT_EFFECT_CHRISTMAS
# define RGBLIGHT_EFFECT_STATIC_GRADIENT
# define RGBLIGHT_EFFECT_RGB_TEST
# define RGBLIGHT_EFFECT_ALTERNATING
#endif

// generated by KBFirmware JSON to QMK Parser
// https://noroadsleft.github.io/kbf_qmk_converter/
7 changes: 7 additions & 0 deletions keyboards/zlant_xl/rules.mk.old
ChrisGVE marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Build Options
# change yes to no to disable
#
# CONSOLE_ENABLE = yes # Console for debug
# COMMAND_ENABLE = yes # Commands for debug and configuration
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
# SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
6 changes: 4 additions & 2 deletions quantum/keycodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand All @@ -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
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
7 changes: 7 additions & 0 deletions tmk_core/protocol.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ SRC += \

SHARED_EP_ENABLE = no
MOUSE_SHARED_EP ?= yes

ifeq ($(strip $(GLOBE_KEY_ENABLE)), yes)
OPT_DEFS += -DGLOBE_KEY_ENABLE
# The globe key require SHARED_EP
SHARED_EP_ENABLE = yes
ChrisGVE marked this conversation as resolved.
Show resolved Hide resolved
endif

ifeq ($(strip $(KEYBOARD_SHARED_EP)), yes)
OPT_DEFS += -DKEYBOARD_SHARED_EP
SHARED_EP_ENABLE = yes
Expand Down
4 changes: 3 additions & 1 deletion tmk_core/protocol/report.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// 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,
Expand Down 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;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this KC_GLOBE does exactly that, and only suitable for switching layouts, not really sending Globe codes.

Copy link
Contributor Author

@ChrisGVE ChrisGVE Dec 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strictly speaking, you are right, but in practice, on a Mac, it operates as a key.

  • pressed alone, it triggers the emoji picker (or what is configured in the Mac settings for the Keyboard)
  • it can be used as a "modifier" with specific keys, for instance
    • Globe+A to toggle the dock when hidden,
    • Globe+C to toggle control center,
    • Globe+F to toggle full screen,
    • Globe+H to show the desktop,
    • Globe+N to toggle Notification Center,
    • Globe+Q launch notes.

Unfortunately, there are other cases where I have yet to have success. In particular, Globe+Arrow keys combinations, but I typically use 60% keyboards, so arrow keys are hard to test with those.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the keycode works on Windows/Linux too (but as layout select), then it would be worth having appropriate aliases too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a pure Windows or Linux machine, but I can investigate using a virtual machine. I'll see whether I have time tomorrow to try that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows does not seem to react to the AC Next Keyboard Layout Select usage, but I can see it coming in through Wireshark.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I tried this morning while at work on Windows 10, and nada, no reaction to the key. I'll try Linux later; I suspect I'll see the same thing.

default:
return 0;
}
Expand Down