Keycombos on streamdeck w/ km sometimes fail

I'm not sure if I can help, but the only way I could help is if you indicate whether you are using the "Kmlink plugin" or the "Keyboard Maestro native Stream Deck plugin".

2 Likes

thanks for the link. so far iam using the "Keyboard Maestro native Stream Deck plugin".

The first thing to determine is whether the macros are triggering - check the Engine.log file (Help ➤ Open Logs Folder menu) and verify whether both macros are triggering or not.

If they are, then go from there, if they are not, then the issue may be on the Stream Deck (or plugin) end.

1 Like

Thanks, will try it and report back once iam back on my computer

Here is what the Engine.log reports when two button action works (i assigned one key to perform SHIFT wich reflects in the report): 2024-10-07 13:34:56 Execute macro “MACRO REEDIT 1 - cut/fade selection [1 to 2] or [2 to 1]” from trigger The ⇧Stream Deck R8C1 key is pressed and this if it doesnt …

So in both cases the same macro is being triggered.

So what is not working? And is it possible that the fact that you are holding the shift key down in one case is affecting the behaviour of the application you are trying to control?

Thanks for your reply, peter. basically its two macros within one big macro, triggered depending on a condition at the beginning. (checking if shift is also pressed). Than instead of moving an audioclip to a track below it moves it to the track above… That´s what it is supposed to do. Sometimes it doesn´t move the clips up (but down) even though i have pressed the shift button in combination with the macro key .
I tried differnt timing of pressing the keys. No matter how i do it sometimes it doesnt work∞ and moves the clips in the wrong direction (always down instead of up)

How are you detecting the shift key? Using the TriggerValue token or some other way?

You should detect the state based on the trigger if that is your intention. And then you can record it to the log file to know what the trigger is.

After that if things are going wrong it will need to look at the actions and why they aren't doing what you expect. As far as I can see the triggering is happening as expected.

i use the TriggerValue token that way:

yes, the triggering happens as expected: one of the two macros will be triggered. Its just the wrong one sometimes. i don´t know if it make a difference, but i didnt use "execute macro" within the "execute the following actions" field. Instead i copied the actions of both macros directly into that field.

It'll really help if you post the smallest version of your macro that will demonstrate the problem -- I, for one, am getting a bit confused as to whether you are modifying behaviour via the keyboard Shift key or with a Stream Deck button.

Duplicate your macro then strip it down to just displaying different "Display text" dialogs depending on the branch taken. People can then see what you are trying to do, have a chance of replicating the issue, and maybe solving it.

Thanks @Nige_S for the heads up.

here is a simplified version of my macro:

MACRO EDIT - cut selection to track below:above.kmmacros (7.6 KB)

I use a button on my streamdeck to perform the shift modifier
so that i can trigger the macro using two fingers of one hand on the streamdeck.

The attached macro should do the following:
when pressing R8C1 on my stream deck it will cut the current selection and paste it on the track below. than it displays "GOING DOWN!" on then screen. When pressing #R8C4 (wich outputs shift) and #R8C1 it should cut the current selection and paste it on the track above and displays "GOING UP!" on the screen.

The idea is to have 8 macros assigned to 8 streamdeck buttons. With the additional shift button i am able to perform 16 macros: 8 macros via one button triggers (the actual button) and 8 more via two button triggers (the actual button + the shift button).
Hope it makes sense now.

Here's an even simpler one!

MACRO EDIT - cut selection to track below:above - SHIFT TEST.kmmacros (4.4 KB)

I'm assuming your SD's "Shift button" is simply:

...and it all works 100% for me.

Test with the above (after changing the USB decide key triggers to suit), and also by using the SD's macro trigger button in conjunction with your keyboard's Shift key instead of the button, in case you've a dodgy SD button that isn't registering "still down" properly.

And check the KM "Engine.log" (you can open the containing folder from the Editor's "Help" menu) where you should see something like

2024-10-09 16:18:07 Execute macro “MACRO EDIT - cut selection to track below/above - SHIFT TEST” from trigger The ⇧Stream Deck R21C23 key is pressed
2024-10-09 16:18:10 Execute macro “MACRO EDIT - cut selection to track below/above - SHIFT TEST” from trigger The Stream Deck R21C23 key is pressed
2024-10-09 16:20:59 Execute macro “MACRO EDIT - cut selection to track below/above - SHIFT TEST” from trigger The ⇧Stream Deck R21C23 key is pressed

...showing when KME did, and didn't, see a Shift key down.

1 Like

If you hold the Shift key down, and then trigger a macro that types things, then Keyboard Maestro has to simulate releasing the shift key and then after typing the key it will simulate re-pressing the shift key. But when the macro finishes, the Shift key will be released because the macro simulated pressing it and the macro will not leave the simulated shift key pressed since that could result it it being permanently stuck on.

So if you do not release and re-press the shift key after triggering the macro the first time, then press the Stream Deck button another time, it will appear without the shift key.

2 Likes

it seems to be intel related (cMP 5,1 running monterey), since the macro wortks fine on my mbp m1 pro.

My demo was written and tested on an Intel iMac, so there's more to it than just a chip difference.

i see, there stil might be a gap between both intel machines. plus iam on opencore…you too?
not sure where to search for to prevent it from failing.

After a few more testing I noticed that I also have the problem on my M1 MBP. but it seems to be a bit more forgiving than on my cMP. What I found out is, that it works better when shift and the actual SD macro button get triggered very fast after each other. If I trigger shift and wait 1-2 seconds to trigger the sd macro button it will always fail. @Nige_S does it really work 100% stable on your end?

Yep -- 100% in my testing.

But if I wanted to Shift-modify an action I wouldn't press Shift then wait 1-2 seconds before pressing the other button... If you want the system to "remember" that you've pressed one button a considerable time (in computer terms) before pressing another you should be setting a variable "flag" instead.

you mean to assign a variable, than request the stored variable and perform further action based on the result?

Exactly. Don't forget to make it a global variable so it persists and is available across macros. (You could use a Dictionary, but let's save that complexity for when you want to store lots of different flags!) You then set it with the 'shift' button and your main macro unsets it soon after the test.

Taking it up a level -- you could store the current timestamp in the variable, perhaps as unixtime. That way, when you press the second button you can include an "if the 'shift' button was pressed in the last n seconds" block.

Exact details will vary. If you never run the un-shifted version of your macro soon after the shifted version you won't need to reset the variable -- it will "time out" naturally. If you do need to to quickly run them one after the other use the first "set and unset" method so you don't still have a 'shift' when you don't want one.

If you are running the Keyboard Maestro Stream Deck plugin you could even make that 'shift' button a toggle, updating the button's icon to show whether 'shift' was on or not and have the behaviour of your macros change for as long (or short) a time as you need!