Can KM emulate the Better Touch Tool ability to distinguish right and left modifier keys?

I always use the 4 left modifier keys (⌃, ⌥ , ⇧, ⌘ ) which leaves me with 4 unused modifier keys on the right. It's a shame because I could have ⌘S on the left to save and ⌘S using the right command key for another purpose.
Better Touch Tool has a feature called Key Sequence which distinguishes between the right and left modifier key when pressed, which is extremely useful, adding a whole range of additional hotkeys (key sequences to be specific).
Instead of having to go through the Better Touch Tool "key sequence" interface to trigger a KM macro, is there any way to program those modifier keys ?
I have had terrible problems (spinning wheel, crashing, could not boot) with Karabiner and never want to install it again.
thank you

The system Hot Key API only supports modifiers independent of left/right.

Keyboard Maestro can detect the left/right modifiers with the USB Device Key trigger.

BTT has a different philosophy to Keyboard Maestro, which allows it to do things Keyboard Maestro wont do, because with Keyboard Maestro I restrict it to public APIs used as Apple defines them. This means Keyboard Maestro cannot do something, but it also is why Keyboard Maestro versions all the way back to version 4.x released over a decade ago works on modern macOS Ventura.

9 Likes

thank you @peternlewis

Here you go:

3 Likes

I will test your macros. Thanks very much !

1 Like

This is rare, but so appreciated, @peternlewis.

1 Like

@_jims Really? Are you still using version 4? Do you know anyone who is still using v4? Or are you one of the majority who always update? Also to support the developer :wink:

Hi, @Frankb. Thanks for the question. It prompts me to clarify.

@peternlewis's conservative approach leads to a rock solid application that I can always count on. And yes, I always upgrade to the latest version.

For different reasons, I've also purchased BTT, but if both can do the job, I'll almost always use Keyboard Maestro.

1 Like

That's just it. There are many reasons to praise Peter. But hardly for the fact that v4 still works with Ventura. :wink:

I know I have helped you with BTT, just as you helped me with KM. Thanks again for this. :slightly_smiling_face:

See. And I do it the other way around. I have a small advantage over you. Since BTT works on a lower level (this is how it was explained to me), I have many shortcuts assigned twice, in BTT and KM. If I close BTT for test purposes, the same shortcuts still work with KM. And if both apps are running, there are still no problems.

1 Like

Hi @ronald. I've tried and liked @noisneil's left/right macros, but eventually transitioned to another approach he contributed: Multipress: Single / Double / Triple / Long

Also, one can use BetterTouchTool to trigger macros. I've got a macro to build the AppleScript. (I know, that's kind of meta but I use it often for BTT and Alfred.)

Download: AppleScript To Run Selected Macro (flattened).kmmacros (18 KB)

Macro-Image


Macro-Notes
  • Macros are always disabled when imported into the Keyboard Maestro Editor.
    • The user must ensure the macro is enabled.
    • The user must also ensure the macro's parent macro-group is enabled.

System Information
  • macOS 13.4 (22F66)
  • Keyboard Maestro v10.2


If you select a macro in the Keyboard Maestro editor and trigger the above macro, you will see a dialog similar to the following:

If you specify an Optional Parameter Value and select the With Parameter button, the macOS clipboard will be populated with a simple AppleScript like the following:

-- Float Specified Apple Notes

property theP : "My Note"

tell application "Keyboard Maestro Engine"
	do script "DE47055C-6D92-4635-9D7D-9CE0ABD2E839" with parameter theP
end tell
4 Likes

@ronald I share @_jims's view. @noisneil's Multipress macro is really highly recommended.

But when it comes to triggering shortcuts with left and right modifiers, BTT is far superior to KM.

But to clear up a misunderstanding, BTT does not do this with key sequences, but with normal shortcuts. In the shortcut section you can choose which modifier you want (left / right).

To trigger KM macros with BTT I recommend the easiest way, which always works in my experience. Assign a complicated shortcut to the KM macro that you would never use (eg. ⌘⌥⌃⇧+F12) and trigger that with a simple macro in BTT (eg. ⌥+a). You can choose if this should be left or right ⌥.

1 Like

Yes, that's another approach if you do not need to supply a %TriggerValue%; however, my preference is to always use an AppleScript because I could see myself changing the KM hot key and breaking the connection.

Your solution is more solid, of course. I simply do what a user who understands little about KM does.

1 Like

@Frankb @_jims @noisneil @peternlewis
I am far from your level of expertise.

My comments pertain only to optimizing the speed of workflow which is basically (I think) why we are having these discussions.

The central problem is memory, ie how to recall triggers.
If I had a prodigious memory, I could use only keyboard shortcuts and type full speed.

Hotkeys are not the solution because they become more and more difficult to remember as they grow in number. Palettes, including conflicting palettes, grow larger and larger (meaning more and more time to read them and find the item I am looking for), both in size and because they include ever more nested palettes. Strings are not the holy grail because you have to remember them and typos are fatal. In terms of workflow, I find that trigger macro by name action is too slow if used systematically as a trigger.

It seems that the answer is a composite approach using as many types of triggers possible, most of them Keyboard Maestro related but extending beyond Keyboard Maestro's limits.

That's where Better Touch Tool comes in because it

  • allows for hotkey consisting only of modifiers, and allows for modifier key sequencing
  • distinguishes R and L modifiers, essentially doubling the number of modifier keys from 4 to 8, which is huge.

Example
• there are some basic macros that I trigger very often, such as sleep display and clear all notifications. With BTT key sequencing which allows for hotkeys consisting of modifier keys only, I can press right control twice for sleep and right shift twice to clear all notifications
• the additional number of modifier keys allows me for example to dedicate my right option key to formatting (the formatting being KM macros that I trigger). By dedicating one key to formatting, remembering the hotkeys is easy RIGHT OPTION KEY + R for red, B for blue, 8 for size 8, § to add tilde to file path, etc

1 Like

I would say you summed it up well. And remember that BTT can also use fn as a modifier.

3 Likes

really ?? that would change my whole configuration.

It was not my intention to upset you :grinning:

But yes, in the BTT shortcut section you can record eg ⌥+a or fn+a. Or any modifier combination with fn.

This actually creates a lot of additional possibilities (that you have to remember :wink:).

2 Likes

great information. thanks very much !

Also worth mentioning the virtues of a Stream Deck. No need to remember hotkeys at all, but of course it does mean taking your hands off the keyboard. Horses for courses.

3 Likes

Stream Deck ... if you don't have one ... not the same, but with BTT you can create buttons (or widgets) on the menubar that are always visible (beside other icons) to trigger macros. Sort of an immovable palette that doesn't get in the way.

I don't know if you can do the same with KM.

1 Like