[Keyboard] How do I long press on keyboard?

Hi,

I've been a BTT amateur user since around the time it got first released.

I've recently decided to improve my workflow a bit since my worn out keyboard has like 4 working buttons left on it. How would I go about accomplishing the following:

[Press ESC key, quick, 0-300ms] --> Action 1
[Press ESC key, long press , 301-...ms] --> Action 2

Help would be much appreciated.

1 Like

Great question! I have the same. Is it possible at all?

Long press for shortcuts is not available yet but Iā€™m working on it! Hope to have this ready in ~2 weeks

2 Likes

9 long months later, my prayers have finally been heard! :pray:

Nice! Looking forward to this feature as well. Love seeing that you're working on it.

Andreas, while you're looking at this could you also possibly look at the ability to hold keys down to trigger mouse buttons, with the appropriate handling of mouse down/mouse up?

Specifically I am looking to bind F1 to LMB, such that whenever I hold F1, LMB is pressed.

In practice this means I need "LMB Down" sent continuously when F1 is pressed, and then "LMB Up" as soon as F1 is released.

I never found a way to do that in BTT, so instead I use Karabiner Elements. That's OK, except it then becomes quite complicated if I want conditional assignment, eg F1 = LMB, but Cmd-F1 = something else, no LMB.

I'd much rather be able to do this in BTT instead, if it's ever possible.

That should already work by using the "Trigger on Key Up" setting for the shortcut:

Combined with the custom click action

1 Like

Oh yes! Thank you.

I'm sorry, I never thought to use two separate actions. That's really great, thank you.

So now I'm wondering: can I do all of the stuff I do in Karabiner Elements, in BTT. The other stuff I have is related to getting my English UK PC keyboard to work fully, and not like an Apple UK keyboard. Like swapping " and @, and putting ` and Ā£ where they should be.

I also use it to assign CapsLock to Cmd+Control+Option+Shift, for then using for further shortcuts.

Karabiner Elements installs as a kext device driver so I guess it works even at the login screen, maybe also across users, which I suppose BTT can't. But other than that I guess BTT can do all of this too?

Thanks again.

Key remapping is better done in Karabiner as it works on a lower level, BTT is more for assigning some non-key actions to keyboard shortcuts.

Swapping " and @ could also be done using a built in tool in macOS, but if Karabiner is working good for you, I'd just leave it.

1 Like

Fair enough. Yeah I haven't touched Karabiner's config in years.

I got my F1 setup working as I hoped in BTT, many thanks again

1 Like

@Andreas_Hegenberg any updates on that one? I really miss that feature, for example I remapped the Dictation button to work as a "push-to-talk" button in Google Meet and I use Shift+Dictation to toggle "permanently" between "mute/unmute", but I would love to be able to just use Dictation button without any modifiers using the option that one could be triggered by a short click, and another one - by the long click.

But then of course there's a question about handling "key up", because when using short click (toggle) - I would only care about "key down", but when using long click (push-to-talk) - I would need to configure "key up" to mute the mic again when stop pressing the button, but ofc I don't want this to have an impact on the short-click behaviour.

I have added this to the latest alpha. For key down you can configure a minimum time before it triggers. For key up you can configure a maximum time before it triggers:

@Andreas_Hegenberg thanks for providing this feature, one of my requirement is long press a single key, not a 'shortcuts', and keep for few seconds such as 2s, will trigger something, it is inspired by 'CheatSheet', while you press 'āŒ˜', it will popup the CheatSheet UI, now I want to provide long press 'control' to trigger something in 'Key Sequences' like what you provided in 'Keyboard Shortcuts', do you think it is possible?

Short/long press does work with a single key, like a letter, but not with modifiers.

It's on my TODO list to make this work for modifiers & also add the ability to specify how long a key needs to be pressed in key sequences. This will take a few weeks before being implemented though.

1 Like

That would be very useful :slight_smile:

If you don't use the modifiers on the right side of the spacebar for shortcuts (like me), it already works with a Key Sequence. Short pressed action, down/up fast. Long press action, up only and hold the modifier a little longer before releasing.