"Execute a Keystroke" for the SHIFT Key?

i use Karabiner to make al my modifiers (Left/Right Command, L/R Option, L/R Shift, Capslock) send out F12-F20 when pressed and released and behave like ordinary modifiers when pressed down.

Then you can use the Function keys in Keyboard Maestro as a trigger.

I have used this setup for years now.
You will have to find the personal settings for timing in Karabiner but it works flawless.

Pressing my left option key once will trigger the KM global palette

Pressing Caps lock will send out F13 which triggers Alfred.

To give a few examples.

1 Like

How do you do this?

tpj2018, I see you understand what I am trying to do. Nice suggestion. I like the idea of using Karabiner. I have to look into this.
How would you apply this to the *Simulating a Keystroke" to be the SHIFT Key?

Thanks

Keyboard Maestro’s simulated modifiers only apply to other simulated events - real events (such as clicking the mouse) will have their own real modifiers associated with them.

Keyboard Maestro cannot generally be used as a way of simulating the behaviour of a modifier key, or for remapping the modifier keys or such tasks. A lower level program like Karabiner Elements is more suited to such a task.

Hi peternlewis,
Thanks for your comments.

I have a key on my Streamdeck device that can execute a KBM macro by assigning that KBM macro to that button on the Streamdeck. I just need that Streamdeck button to behave like the SHIFT Key on my keyboard.
In other words, if I hold that button on my Streamdeck and keep holding it, I need it to behave the same way it does when I press and hold the SHIFT key on my computer keyboard.
If I let go, it would be like letting go of the SHIFT key on my computer keyboard.

How can I accomplish this using Karabiner Elements?
Thanks!

I do not think that is possible because the Karabiner Elements EventViewer does not recognize StreamDeck buttons.

You might consider having the Streamdeck button set off a KM macro, then have the KM macro detect whether a modifier button on the keyboard is pressed - based on that the KM Macro can proceed accordingly.

Or you could use a keyboard or mouse with programmable macro buttons instead of the StreamDeck.

Or you could use the Logitech Farm Sim device Logitech Heavy Equipment Side Panel -- The ultimate customized USB input device? instead of the StreamDeck.

1 Like

I am trying to have all my common keys on the Streamdeck to avoid going to the keyboard when I am working on some apps. On my image at the beginning of this post, the "Simulate Keystroke* in KBM would be perfect for this, but it doesn't let me pick the SHIFT key as an option. I am very surprise that option is not there.

Maybe there's another app or utility that I need to look into to accomplish this.

Thanks for your comments!

Hammerspoon might be able to pull this off. I scanned the docs and didn't see anything right off, but it's worth a look

That would be a question for the Karabiner Elements developer, although I suspect it is not possible.

I misundertood your question a bit.
So you want the streamdeck button to behave like shift.

Streamdeck button down ( press ) = shift down
Stream deck button up ( release ) =shift up
Correct?
That will not work in Karabiner but it will work in Controllermate as long as CM sees a button down and up event from a Streamdeck button.

If yes its not very hard to build this behaviour in Controllermate.

You always have to be careful playing with modifier down presses. You have to create your own safety net within Controllermate.
For example. If escape is hold down for 3 seconds. Disable Controllermate Helper. Thats always a good start.

It has a free trial so you can test it.
This will explain about the safety net and working with key up/down events.
https://www.orderedbytes.com/controllermate/doc/#precautionary_measures

This example shows how to do a shift + click. If you remove the mouse click part from this example you have exactly what you want to do.
https://www.orderedbytes.com/controllermate/example/#example_006

That's the whole point - I don't think the StreamDeck will behave as desired with any software. If you really wanted to do this with StreamDeck, you probably would need to write your own driver software for StreamDeck so that it would mimick a more typical USB keyboard.

StreamDeck is a wonderful wonderful piece of hardware. But one of the reasons it does such unique things is because it is not just another USB keyboard. And for that reason you probably cannot achieve the low-level control over each keypress that you want and that you could easily achieve with other devices.

If you do use the Streamdeck, then the hybrid approach I suggested of writing a KM Macro that recognizes the Streamdeck keypress and then also recognizes a modifier key on your regular keyboard may be the best you can do for this task.

Thanks tpj2018.

Yes,
I want the streamdeck button to behave like the shift key on my keyboard.

Streamdeck button down ( press ) = shift down ( and stay down until I release )
Streamdeck button up ( release ) = shift up

I will take a look at Controllermate. Thanks for the suggestion.

It looks like Controllermate is not compatible with MacOS Catalina. Only with macOS 10.13 High Sierra and macOS 10.14 Mojave.

Yes, but it does work. You will have to check if your usb device will work as a trigger.
You can always install a trial.
Im pretty sure an update will come, but updates are usually slow.

I know what a streamdeck is. CM is not a ordinary keyboard remapper.
I have still have to find a device that is not recognized as a input device in Controllermate.
If Streamdeck can send a key to OSX or KM then Controllermate can modify it.
From gamecontrollers to wacom tablets to midi messages to xkeys.
The whole point is that you need an app that actually can execute key down/up presses for system modifier keys without the contraint of a macro that ends.

Well Controllermate does seem quite interesting

But it does not seem to work on Catalina - I installed it but it did not detect any of my devices (not even my basic keyboard) and that appears consistent with what is discussed on Reddit.

Let's hope they introduce a Catalina compatible version at some point.

tell application "System Events"
  shift key down
end tell

delay 30

tell application "System Events"
  shift key up
end tell
1 Like

Thank you jhein.

I am new to Keyboard Maestro. Where do I insert this code?

Thanks again!

You need the "Execute AppleScript" Action:

You can just download my test macros here:
810 DEV Sandbox Macros.kmmacros (3.3 KB)

The most important thing is, that the trigger to release the Shift-Key again, must include the Shift-Key or you will not be able to press it. (I found this out the hard way and I was using the Alt-Key)

Thank you for your kindness and help!
I wonder if it will work by making the trigger key a key on my Elgato Stream Deck. That would be perfect! I will try this and see.

Best regards