Help with a shortcut configuration

I want to configure the F1 key like this:

F1 pressed --> no action
F1 released before 0,31 seconds --> show a dialog box and stop the actions
F1 pressed more than 0,31 seconds --> send midi message "A" after 0,60 seconds and another midi message "B" after 0,80 seconds
F1 pressed more than 1,2 seconds should send a midi message "C" and cancel the sending of the midi message "B"

I have tried several things, but I am not getting a good result.

How would you do it?

I think you need to set up something like this (below). The problem is that the actions are triggered when the key is released. That means you have to estimate the time, which probably doesn't work.

Thanks @Frank1 but it's not possible to do it with shortcuts.

I think the configuration I want must be set with key sequences, or mixing key sequences and shortcuts.

Do you want to trigger these while still holding f1 or when releasing f1?

While still holding it.

Maybe this is more clear:

F1 pressed more than 0,31 seconds --> send midi message "A" after 0,60 seconds and another midi message "B" after 0,80 seconds
F1 pressed more than 1,2 seconds should send a midi message "C" and cancel the sending of the midi message "B"
F1 released between 0,32 seconds and 1,2 seconds allows the sending of the midi message "A" and "B" but no midi message "C" is sent
F1 released after 1,2 seconds does nothing

In my understanding it doesn't completely fit:

So A shall be triggered after holding for 0.91seconds (0.31+0.6)
B shall be triggered after 1,11seconds (0.31+0.8) - or do you mean B should be triggered after 1.71seconds(0.31+0.6+0.8)?

I

"A" and "B" shall be triggered if F1 is pressed more than 0.31 seconds and released before 1,2 seconds: "A" would be triggered at 0,91 and ""B" would be triggered at 1,71

But if F1 is pressed more than 0,31 seconds and not released after 1,2 seconds, "A" should be triggered at 0,91, "B" should be canceled, and "C" should be sent at 1,2

This is currently indeed hard to, mainly because only one shortcut with the same key combo and a minimum press duration can exist.
I think I can remove that limitation for this special case easily. I'll check tomorrow.

I think I get it.

I have configured one F1 press in the shortcuts section and several F1 releases in the key sequences section, using variables and time action sequences.

I explain it below, maybe somebody can find it useful.

@Andreas_Hegenberg I agree that is hard to do something like this now. Great if you can implement an easier way! :slightly_smiling_face:


SHORTCUTS SECTION

F1 configured as TRIGGER ON KEY DOWN, all time values to zero, with three actions:

The first action sequence is called "SetKeyPressedTo2" with a timeout of 0.3 seconds. It includes these actions:

The second action sequence is called "SetKeyPressedTo3" with a timeout of 1.2 seconds. It includes these actions:


KEY SEQUENCES SECTION

Two triggers with only one sequence (the release of the key) with all time values to zero. Both triggers have different advanced condition for the variable KeyPressed:

F1 released (1) has these actions to cancel the action sequences "SetKeyPressedTo2" and "SetKeyPressedTo3":

F1 released (2) has only one action to cancel the action sequence "SetKeyPressedTo3":

The configuration I posted yesterday is not a good solution.

After some presses/releases, the F1 key stops working and it doesn't trigger nothing. Restarting BTT fixes it.

I guess that mixing the press and release of the same key in shortcuts and key sequence is not a good idea…

With 5.511 I implemented the change that should allow for this, here is an example for F1:

F1.bttpreset (15.7 KB)

They key changes are:
1.) You can now have multiple shortcuts with minimum hold times > 0

2.) The "Execute Action Sequence After Timeout" action got an option to immediately continue executing the remaining actions in the original action sequence. (This was how it was originally intended but some refactoring a long time ago changed this behavior)

It's working perfectly! :grinning:

One question: Why in the "Execute Action Sequence B After 1.40 Seconds" you put a "Cancel Timed Action Sequence B" in the list of actions? I don't understand that…

ah that's probably a copy & paste leftover :wink: it shouldn't be necessary

1 Like

I wonder if there is a problem with the new checkbox to immediately continue executing the remaining actions in the original action sequence in the "Execute Action Sequence After Timeout" action.

When I imported the preset you posted, this checkbox was disabled in the Action Sequence A. I enabled it.

After that, I cut the trigger and pasted it in another place. Once pasted, the checkbox was disabled again.

ah that's possible, the action uses some special export code and I haven't added it there yet. Will do.

1 Like

You could also check this issue: very often the actions are hidden when I open the configuration of Action Sequences. Clicking outside the trigger and the trigger again fix it:

in your screen capture it looks like BTT is not the active window (your window buttons are not colored). Are you cmd + clicking? Or do you know what causes this?

No, that's because I have the graphite color as the contrast color in the system settings. This configuration makes everything gray, I feel more comfortable with that.

This is the same with standard contrast:

1 Like