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?
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.
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”?
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).
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...
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...
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 ⌘.