Using several Modifier keys in an Action

Hi there. Loving KM so far.
In Photoshop you can hold down Ctrl and Option to then adjust the size and softness of the brush with the mouse. I'm trying to create one button on my external keypad that replicates holding these two buttons down.

I've used the "type Modifiers" action and selected ctrl Opt but it doesn't seem to do anything.
I've even tried press and hold etc.

Has anybody else managed to do this? Can't find another suitable action module to try.

Thanks

Chris

Karabiner Elements is your friend in this situation.

KC

1 Like

Thanks. I didn't really want to spread across two softwares, but if Keyboard Maestro can't do it then I'll give it a go. Cheer

Apologies KC. I've downloaded Karabiner but afraid I've no idea how to use this to solve what I can't seem to do in KM. Any chance you can send a screenshot please of what I need to set up?
KM seems to do so much, I'm still amazed it can't map the two modifier keys to one button.

You might be able to, by having your macro do a "Type Modifiers -- Press and Hold", then "Pause Until..." something happens. You do whatever with your mouse then do the something the macro is waiting for and it then continues, either releasing the modifiers explicitly or when the macro finishes. But that will depend on whether PS treats simulated modifier keys the same as actual keypresses.

For the non-Photoshop users amongst us -- what do you do with/to the mouse to make the adjustments?

I don't know what button you are mapping to but you can go to this Karabiner Complex Modifications Page and find a modifier selection that is close to what you want to do. Select the Import Dropdown menu and select Edit JSON. It will open a popup with code that you can adjust. It may take you a moment but you should be able to figure out by typing your control + option to map it to a key of your choice. Once you do that, just import/install it.

I know there are plenty of wizards here that use it for a Hyperkey and other bindings. I only use it for the Hyperkey. I wouldn't dare change my Photoshop control/option modification 20 years in. :slight_smile:

I hope this helps you.
KC

You can't mix simulated and real events like that unfortunately. As soon as you physically move the mouse or press a key, KM "releases" the held modifiers. AppleScript can do it, but as with everything AppleScript, there's lag, so I'm not sure it would be a very nice experience in this case.

@ChrisPhotographer, I haven't used Karabiner myself, but it sounds more promising. It's free and not resource-heavy, so you might as well try it out.

D'oh!

I really need to get that tattooed somewhere obvious so I remember it...

You can kludge something in KM but, quite frankly, it's horrible to use!

Photoshop Brush Resize.kmmacros (5.6 KB)

@ChrisPhotographer -- mine's another vote for Karabiner for doing things like this. Although I'm not sure what you're trying to achieve -- it doesn't seem much easier to keypress an external device than to hold down ⌃⌥ (unless you are trying to keypress to lock them down, another keypress to release, so you do the brush resizing one-handed?).

@Nige_S, as I understand it, he just wants to simulate two modifiers with one key; the mouse move will always be manual. I like your idea though, and it might actually be better, depending on his preference.

@ChrisPhotographer If you think you can get into the habit of pausing for half a second between pressing the key and using the mouse... Have a go with this, setting both triggers to the same keypad key:

Multiple Modifiers with One Key.kmmacros (22 KB)

Macro screenshot

(Personally, I'd still prefer the Karabiner route.)

My guess -- and it is a guess -- is that OP is after caps-lock-like behaviour. Press button to "lock" ⌃⌥ down, do mouse stuff, press button to release ⌃⌥ so that this becomes a one-handed operation.

But that's only because it's quite easy to hold down ⌃⌥ with one hand, even one finger or thumb, while mousing with the other hand -- so I can't think another added value to this.

BTW, even with the lag your macro runs nicer than my nasty, nasty, version.

Maybe you're right. I don't think that would be a good idea tbh, as you could easily "turn on" the modifiers without realising it. Unlike the capslock key, there's no little green light staring up and judging your lack of dexterity.

I assumed that "one button on my external keypad" meant he wanted to hold one button to simulate holding the two modifiers.

@ChrisPhotographer can you clarify your intended use?