Keyboard shortcuts: configure different functionality for long or short presses

You need at least BetterTouchTool version 3.766 to do this

To setup a shortcut that triggers one function on short press, and another on long press do it like this:

For Long Press:

For Short Press:

Thanks!
Would it be possible to create a long-press variant out of a standard shortcut without creating an infinite loop?

Currently i have cmd-alt-c as shortcut for the following:

  1. send cmd-C (to copy selected text to clopboard)
  2. execute shell script "pbpaste | /usr/local/bin/jq | pbcopy" to format JSON and put back to clipboard

It sould be awesome to execute the above via long press cmd-C.
I cannot find any other way to "copy to clipboard" than actually sending a cmd-C.

Not exactly what you want. But, how about the key sequence cmd+c+c to „copy selected text to clipboard" and "execute shell script“? No infinite loop if you record this way.

Alternatively, just use "c". But you have to set up two actions.

Short pressed, c = c, 0 - 0.2 s, enable "Prevent recursive triggers"

and

Long pressed, c, any action, 0.25 s or longer.

This works well if you don't write too fast.

Hi @Andreas_Hegenberg,

thanks for the great feature! I have a question about Trigger on Key Up action - what's the recommended way to set unlimited Maximum hold time?

That's my use-case:

  • Trigger on Key Up between 0s-1s to trigger short press action (toggle mic: mute / unmute)
  • Trigger on Key Down from 1s to trigger entry long press action (push to talk: unmute mic)
  • Trigger on Key Up between 1s-unlimited to trigger exit long press action (push to talk: mute mic)

@Andreas_Hegenberg

I played a bit with the configuration and found some issues with Minimum hold time. I exported a preset and found out that:

  • for the below action:
    image
    I get:

    "BTTTriggerConfig" : {
      "BTTKeyboardShortcutMaxTime" : 0.25
    }
    

    so it seems fine.

  • for that one:
    image
    I get:

    "BTTTriggerConfig" : {
      "BTTKeyboardShortcutMinTime" : 0
    }
    

    so the value is not preserved.

  • for that one:
    image
    I get:

    "BTTTriggerConfig" : {
      "BTTKeyboardShortcutMinTime" : 0,
      "BTTKeyboardShortcutMaxTime" : 3600
    }
    

    so BTTKeyboardShortcutMaxTime is correct, but BTTKeyboardShortcutMinTime is again not preserved.

    PS After saving the above and re-opening, BTTKeyboardShortcutMaxTime value displays as 10 s:
    image
    but in config it's still fine (so 3600 s).

1 Like

@Andreas_Hegenberg This issue regarding BTTKeyboardShortcutMinTime becoming stuck at 0 seems to still be present in the latest version (3.837).