Show a palette while a key is held, pass the key through on a quick tap (Cubase)

I'm trying to get KBM to display a pallet on long press (or specified length such as .5secs) and to continue to display the pallet as long as I have the hot key held down. Then to close the pallet when I release the hot key. I also want to retain the quick tap functionality of the hot key so that on quick taps it performs another macro (or set of macros). Is this possible in KBM? I also have just started dabbling with Karabiner if this might also be of assistance.

Cheers

If you read the following page:

You will see that the "long pressed" trigger is actually triggered when the key is RELEASED. So on that basis, you can't use that trigger ("long pressed") to trigger any macro.

However this should still be possible using a different trigger. You see, there's another trigger called "is down" which triggers several times per second (it looks like 15 times per second on my Mac) if a key is being held down. It should be fairly easy, I think, to place some code into such a macro to detect if the key has been held down for over a half second.

This macro would have to understand several states. One state is the state that the key is not pressed. Another state is that the key is not pressed BUT we have to close the palette. Another state is that the key is pressed and the palette is visible. Another state is that the key is pressed and the palette needs to be turned on. That makes four states. I think I can solve this problem. I will do some testing now.

Bear in mind that when I write this code, it will result in about 15 macros running almost simultaneously as long as the key is held down. This shouldn't be a problem, since KM supports 50 macros running simultaneously.

I am happy to report that I got it working. In this macro, rather than turn a palette off or on, I turned a different window off or on, that is, the Display Progress Bar window. But it should be very easy (trivial) to replace that with a palette action. What I did in this macro was get the framework working, and anyone can replace the Display Progress Bar with anything that they want, including palettes.

You may want to replace the F18 hotkey with some other hotkey. Note that there are two places in this macro where you have to change that hotkey.

This macro can be simplified. I had expected it to require 4 states, but a couple of the states (2 and 4) were hardcoded instead of softcoded. I left it as is so that you can see my thought process of using many "states."

I hardcoded a value of 0.5 seconds in this macro, because that's what you seemed to want. You can also change that if you wish.

It seems to work for me, but if you find a problem, let me know. I often write code like this, involving states and timers, so this took me under 30 minutes.

F18 Tap Test Macro (v11.0.4)

F18 Tap Test.kmmacros (12 KB)

As it turns out, the concurrent macros are completed so quickly that you should never see more than two copies running concurrently. I had expected 15, but I forgot how quickly these macros would complete.

I just realized I omitted something. This solves the hard part of your request, but the easy part of your request was to allow the function key to maintain its regular effect if it is pressed once. I think that will be an easy fix, but I need a little more time to consider it. It all depends on whether you want the regular hotkey function to be suppressed when the user holds the same key down for a long press. If not, the solution is trivial: just create a regular hotkey macro. But if you want the suppression to exist, then we have to add a little code. So which is it?

I have been using this macro from Zabobon for a long time. It's perfect for my purposes.