Send globe key action

I've been moving more and more stuff from Karabiner Elements to Keyboard Maestro, I was sick and tired of editing a 4000 line JSON file with search and replace just to get more Emacs keyboard shortcuts. Yesterday I've uninstalled the former and found that since it no longer spoofs all keyboards as Apple keyboards, the function key on my Logitech G Pro no longer functions as a globe key. Unfortunately, the globe key is the only way to change input language in iPhone Mirroring. What I'd like to do is rebind command-space to the globe key by itself. While I've been able to eg make a macro send globe-control-c to center a window, I couldn't figure out how to send just the globe key — is it possible?

Did you try this action: (Type a Keystoke, and press the Globe Key in the box)

image

But wait, maybe you wanted to use the Globe key as a MODIFIER, not as a key. If that's what you mean, this may be a problem. You didn't say if that's what you are trying to do.

Oh, this is a very unfortunate way to do it because it requires you have a keyboard with a globe key in the first place. @peternlewis I think there should be some sort of workaround for typing keys you don't have, unless there already is one I'm missing. Same with F13-F20, I guess, maybe other keys. In fact since 40% keyboards exist there should be some general facility for choosing standard keys from a list, so one can set up a number layer with KM without having to reach for a more standard keyboard.

@Airy I briefly stole an Apple keyboard from my dad to set this up and now it does work for my specific purpose, thank you!
Although if you know how to make some key combo send the globe as a modifier, I would be interested as well.

Like the one included in the action, perhaps? Just click on the down-arrow next to the input field:

And no, the Globe key isn't there... IIRC it was originally a bit of oddity and couldn't be simulated or captured, and while that may have changed the action's list has yet to be updated.

The Architect of KM said a while ago that Apple's public APIs prohibit apps from using the Globe Key as a modifier. There may be some other apps out there that use undocumented APIs to accomplish this, but I don't use those kinds of apps, so I can't help with that.

Nige showed the best way to solve that. Another way is to use the macOS Keyboard Viewer, which allows you to "type keys you don't have." It works with most keys, but apparently this utility hasn't been updated by Apple to include the Globe Key. (It has an "fn" key, but it doesn't work like the Globe Key.) You may have to set a flag in the accessibilities pane of System Preferences in order to make this feature available through the system menu. This is how I "type" if my keyboard is broken, out of batteries, or missing.

@Airy I've checked it after seeing your reply and also found it doesn't have a globe key. Hopefully it will become less of a magic key and just another modifier over time, can't have too many of those, but that's on Apple, not KM.

Since KM does recognize the globe key and I got my iPhone Mirroring workaround working by setting up a macro that sends the globe key to it, I think it should be added to the list of keys included with the action.

The iPhone Mirroring team isn't doing too hot on localization, since 15.2 it's started to use the French-Canadian keyboard layout on a MacBook that came with it, even though macOS is configured to use the generic American ABC layout. I've considered remapping all the different punctuation keys for it as well, but it's too much work.

Anyway, the topic's core issue has been solved, thanks for the help!

1 Like

If you want another way of doing it, this AppleScript works:

delay 5
tell application "System Events"
	key code 179
end tell

Run in Script Editor and you've 5 seconds to switch to the KM Editor and activate the "Type a Keystroke" input box. I think the key code is the same across localisations...

You can, of course, make it into a macro -- again with a delay to allow you to hot key then re-select the field.

Or you can remove the delay and run it from a palette after activating the input field.