Type Modifier Doesn't Hold Consistently?

I'm trying to make a momentary key stroke that will trigger a particular mouse tool in Logic (Multi-Scissors). This tool is invoked by first using pressing Ctrl+Option+Command+F3 to get the Scissors tool, then whenever you are holding down the Option key, it changes to the Multi-Scissors tool.

The problem I have is that it doesn't seem to hold the Option key consistently - the mouse pointer flickers between the two tool variations. Is there any way around this?

Trying to get Keyboard Maestro to press only certain keys whilst you are in fact pressing other keys tends to be problematic.

@peternlewis – anything to add?

-Chris

Real events and simulated events have different sets of modifiers.

So generally you cannot use simulated events to hold keys down while you perform real actions, just the same way as holding the shift key down does not affect simulated typing.

Thanks @peternlewis - does that mean that this is not possible?

It's frustrating because it almost works. It just randomly flickers between the two tools.

Pretty much - as soon as you make a real event, the modifiers will revert to the real modifiers.

Sorry if I'm a bit slow, but what exactly is a "real event" in this context? None of the key presses are 'real'.

Any event generated by the hardware will have its own modifiers. Moving the mouse, pressing a key, or any other hardware event.

Also note that any held buttons will be released when the macro completes, so the Hold option in your Press and Hold the Option Modifier action is pointless because the next thing the macro will do is terminate, releasing the Option key - in fact if you move that action to the end of the macro, Keyboard Maestro will actively warn you that it is redundant, but it can't detect that it is at the end because it is nested in another action.

Thanks for the explanation @peternlewis. Obviously a limitation of how MacOS deals with key press events, but at least I understand a bit more about how it all works now!

I could be wrong (and I probably am since you're the developer!) but I don't think the modifier action was redundant in this instance, as that part of the macro seemed to be triggering fine - the modifier was definitely pressing, just intermittently rather than constantly. Presumably the fact that the If statement was continually checking the state of the hot key keeps it active?

The macro is running periodically (because the trigger is “is down”). Each time the macro triggers, the if statement is pretty much guaranteed to be true (cuz the macro just fired), and so the Option key is pressed and held down for a fraction of a second and then released because the macro completes. Then a short while later (KEYREPEATINTERVAL function), the macro runs again.

That is why it is flickering.

The Command-Option-Control-Shift-F3 will be happening multiple times as well, and the Command-Option-Control-F1 will probably never happen, though it may occasionally.

I don't really understand what you are trying to do, what are you doing with the “Multi-Scissors tool”?

Thanks for the explanation - I understand now!

So, the normal Scissors tool just cuts regions in two, as the name suggests. The Multi-Scissors tool cuts a region in several places at once, at regular intervals (so if you cut, say, one beat from the start of the region, the region will be cut at every beat).

The multi-scissors tool is invoked by holding a momentary modifier (Option) while the Scissors tool is active. The Scissors tool can be invoked with a user-assignable key command (currently Command-Option-Control-F3), but the Multi-Scissors tool can only ever be invoked with the momentary Option key while the Scissors tool is active.

I don't often need the normal Scissors tool in my workflow (you can achieve the same thing with other tools), so I wanted to create a button on my Stream Deck that would just go straight to the Multi-Scissors.

(The Command-Option-Control-F1 command at the end of the macro is "return to previous tool", i.e. whatever mouse pointer was active before the Scissors tool. This was so I could make the Stream Deck button momentary, but isn't super important).

Hey @allthebuttons,

Don't know whether you've found a solution for your Logic problem, but I think the main problem you are facing here might be that depending on your application any key (in your case the ' key) might be auto-re-triggering the macro when being held down... just like in MS Word when you press the Erase/Backspace kay and hold it down it will erase one letter and then after a short pause it will continue erasing... so here it can be that holding down ' will cause the macro typing your first action (shift-option-cmd-F3) over and over again... can you reproduce you flickering behaviour by holding down or fast-pressing this combination in Logic?

I had the same problem here while experimenting with macros that were based on holding down a key on the keyboard - I've implemented a flag variable in a similar IF/THEN construction as a beginning condition for the WHOLE macro. Aside from being a little tedious it works...:wink:

Another way might be turning off the key re-trigger [key repeat] in general in Mac Prefs... but then your MS Word might get a little bumpy or you might injure your wrist by pressing Backspace too often... :wink:

You may already know this, but if you turn on advanced features in Logic, you can have three tools instead of just two. Mine are set as follows:

Pasted_Image_26_04_2022__10_33

From left to right:

  • Pointer (default)
  • Scissors (hold ⌘)
  • Marquee (right click)

For the multi-scissors, I just hold ⌥⌘.

This added flexibility might mean you don't need to manually select the scissors tool before invoking the multi-scissors.

Hi @noisneil yes I already use the three tools - I was trying to cheat a fourth tool on my stream deck! I normally do 'scissors' work by double-clicking the Marquee. The only thing this doesn't work for is multi-scissors, which requires switching to the scissors tool and holding down ⌘.

How about this?

Multi-Scissors.kmmacros (23 KB)

Macro screenshot

Ignore the above; it won't work, because...

@allthebuttons However...

This works!

Multi-Scissors.kmmacros (23 KB)

Macro screenshot

Edit: added a 3sec timeout to the mouse button pause.

Yes this worked! Thanks so much! :smile:

1 Like