I'm just getting started with a new Glove 80 keyboard that uses ZMK firmware.
With a previous keyboard I had been able to make use of application launch commands to have KM launch or bring a specified application to the front. Using such a command generated by the keyboard also meant that if KM didn't handle it, then it would be ignored and I wouldn't risk stepping on useful key combinations. (I vaguely seem to recall that this ability went away sometime in the past, but I'm not sure.)
ZMK has the ability to generate such USB commands that are part of the spec. For example, C_AL_EMAIL to launch an email application, or C_AL_CALC to open a calculator app. I tried setting these up to see if I could have KM be triggered by them, but they don't seem to be working.
Is KM supposed to be able to see such events? If so, how? I tried both Hot Key and USB Device Key triggers.
Is there a way to see what is being generated by the keyboard for such events? (This might be a nice feature for KM.)
If this method isn't possible, is there a way to configure ZMK to generate a value that will be ignored by the OS and applications but can trigger a KM macro?
Note: KM is so well designed that I've been able to use it for years and years without ever needing to ask such a how to question, until now.
We have a free app called Key Codes that displays a bunch of info when you press a key; maybe it'll help (no idea, but hey, it's a freebie). It's mainly for developers, but perhaps useful in this case.
It sounds to me (although I could be wrong) that you have configured your software to launch apps when keys are pressed. By doing it that way, your keys are probably not detectable by macOS, and therefore are not detectable by KM, since KM relies on macOS.
Why would you want KM to perform an action if you are already programming your keyboard (through its software) to perform an action? If you don't like the software that comes with the keyboard, then perhaps stop using it and start using your keyboards normal USB key behaviour without using its additional software. That's what I would do.
There's a 50% chance that I misunderstand your situation, but I wanted to take a shot.
Yes, it does seem you've misunderstood. The "software" is the keyboard's firmware that lets me configure the "keyboards normal USB key behaviour". The functions I cited are part of the USB spec. KM is the software that should be handling the application launching for me.
The challenge is in figuring out why that USB action isn't available. Is Mac OS filtering it out before any app sees it? Is there another way to accomplish the same thing?
Do you mean you created those triggers and then pressed the keys while the trigger box was active? And do you mean nothing changed when you pressed the keys?
Well done on choosing a keyboard that is programmable using ZMK. As a user of the similar QMK, I occasionally preach to these heathens about programmable keyboards but they won't listen.
I'm not familiar with application launch codes such as "C_AL_EMAIL" but I found a compatibility chart here:
You have to hover the mouse pointer over the columns to reveal hidden information (now that is like MacOS!). If you do so, you will find that all the codes in the "Applications (Launch)" table are, for MacOS, marked either as "unsupported' or "not tested yet".
I note however that you say you were able to use such codes on a previous keyboard. All I can say is that, if the same codes are being produced by both keyboards, the same codes are being received by the Mac!
I don't know ZMK well, but as I recall, it was inspired by QMK, and I know as a QMK user that there are all sorts of unused, obscure codes that can be used if you need to. But I must say that I have been content by other approaches such as getting the keyboard to send unused function keys (e.g. Fn-19), and (on the Mac side) by having a pretty standard system of combining conventional keys – e.g.:
⇧⌃⌘-K to switch to Keyboard Maestro
⇧⌃⌘-E to switch to the text Editor
… and other rarely used combinations such as
⇧⌃-whatever to trigger app-specific macros.
(No, I don't have a Whatever key, or an Any key).
KM gets its input from the OS, so no. Just try using a conventional key code or key combination that other apps are unlikely to use. There really are plenty, it seems to me.
Just in case there's any uncertainty still, when a keyboard is programmable it essentially means that you can specify which key (or combination of keys) produces which code, so you can freely devise a layout that works well for you. It all makes more sense why you would want to do that once you start looking into concepts such as layers and… No..! Run away! Save yourself while you still can!
Oo, you might be getting warm there, since ZMK was, as I recall, mainly created because QMK didn't support wireless keyboards that well. So wired/wireless makes a difference sometimes but I know nothing about it.
That's the chart I was using to try to figure out what to use. The codes I mentioned are in the "Applications (Launch)" section.
I plugged in an old Logitech keyboard that has dedicated keys that do the same things. KM was able to see the function generated by that keyboard using the USB Device Key trigger (displayed as "AL Email Reader"), but can't see the equivalent code generated by the Glove 80 for some reason.
Following this line of thought, I tried setting up F21 through F24 keys. macOS can't see them at all, but KM can see them as USB Device Key triggers, so that's what I'm using for now.
The previous keyboard was wired. This one is capable of both wired and wireless. I'm using it as wired because I don't want to worry about batteries or any potential radio interference.
Yes I spotted it (that's why I mentioned that section).
Since you have been using both keyboards by wired connection, could it be that the Glove 80 is not sending the code? Just to check the basics: you definitely have flashed the Glove 80 with your layout and all that sort of routine stuff? And the fancy codes are not perhaps limited to certain chip sets or something like that?
A further Web search tells me that "AL Email Reader" and the like are part of the Human Interface Device (HID) protocol. The page Human interface device - Wikipedia mentions that:
Any of the first 256 key codes ("Usages") defined in the HID Usage Tables, Usage Page 7 can be reported by a keyboard using the boot protocol, but most systems only handle a subset of these keys.
I should think it unlikely, but could it be that the Glove 80 does not support as wide a range as the Logitech keyboard?
Furthermore, not all KVMs implement an adequately complete implementation of HID protocol. As such some models of KVMs are not compatible with certain keyboards which may include Glove80.
I thought it better not to mention USB Device Key triggers because I thought I might muddy the waters further, but I'm glad to hear that you tried that and that it worked.
Since we had tracked down that the code worked from the Logitech but not the Glove 80, that put my focus on its implementation being the source of the issue. And that's what I found. As you cited from Wikipedia:
It turns out that there's an advanced setting for whether or not to send such codes. (HID_FULL_CONSUMER_REPORT) By default, this feature is disabled for exactly those compatibility reasons. I don't know if this is just for the Glove 80 or for ZMK in general.
Enabling this option did allow the Glove 80 to send the Application Launch codes. And now I can have KM handle those codes via the USB Device Key triggers.
No.
It's now working as I had hoped. Thanks so much for your help.
This very short video is a great introduction to the idea.
The middle section can be skipped since it is a demonstration of setting up the company's own 'Raise' keyboard, with lots of quaint mousing around instead of using a text editor.
For anyone who was wondering: programmable keyboards do not have to be split. After all, some people can actually touch type on a conventional layout, or maybe just enjoy shoulder pain.