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 16 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
12 changes: 12 additions & 0 deletions data/constants/keycodes/keycodes_0.0.4_basic.hjson
ChrisGVE marked this conversation as resolved.
Show resolved Hide resolved
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",
"aliases": [
"KC_GLB"
]
}
}
}
1,430 changes: 716 additions & 714 deletions docs/keycodes.md
ChrisGVE marked this conversation as resolved.
Show resolved Hide resolved

Large diffs are not rendered by default.

445 changes: 224 additions & 221 deletions docs/keycodes_basic.md
ChrisGVE marked this conversation as resolved.
Show resolved Hide resolved

Large diffs are not rendered by default.

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
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.

You're right about the VM. Indeed, this is what happens when I connect to work via Citrix (the reason so many of my colleagues have keyboard problems). I'll try it again by configuring Parallels properly. I'll do a search, but by any chance, do you know any Linux software that would capture keyboard events like Karabiner on the Mac?

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 succeeded in passing all my keypresses to the Linux session running in VM. I've monitored the keypresses using xev, which is pretty basic but does the job. Like with Windows, the result is no report of any key being pressed when using either the Globe on its own or in combination with another key.

Copy link
Member

@fauxpark fauxpark Dec 7, 2024

Choose a reason for hiding this comment

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

I figured that might be the case, considering X keysyms only go up to something like 240; KEY_KBD_LAYOUT_NEXT has a value of 584. evtest might have better info, but even so, I'm not sure what the mechanism(s) would be, if any, to get the key to do something useful.

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually xkeyboard-config has support for KEY_KBD_LAYOUT_NEXT in symbols/inet since xkeyboard-config-2.33 (the <I592> keycode (linux_input_keycode + 8, as usual) gets mapped to ISO_Next_Group). The problem is that the X protocol does not support keycode values above 255, therefore that mapping would work only in Wayland.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, clearly, there is atm only a use case for macOS but it is a big one for Apple users. I'd wish to know how to make all the other combinations work but that's already a beginning that would benefit this group of users.

default:
return 0;
}
Expand Down
Loading