Map A-Z Keys with Long Press without Affecting typing speed.

So I am looking to assign alternative actions to ALL A-Z keys. The problem I am running into is that this affects regular typing. If you type too fast, then some of the characters are not captured or even captured incorrectly. i.e., you try to type "image" but what comes out is "mmg".

I followed this example and set my keys thusly:

EXAMPLE, ASSIGNED TO KEY "A"

Long Press (Alternative Key)
Trigger on Key Down
Minimum Hold Time 0.3
Action - Type Custom Text: " ã "

Short Press (Regular Key)
Trigger on Key Up
Minimum Hold Time 0
Maximum Hold Time 0.2
Action - Type Custom Text: " a "

Anyone know how to get it to work?

Thank you

if anyone then @Frank1 might be able to answer this :sweat_smile:

Damn lol, I look forward to what @Frank1 has to say!

Having tested it a bit more now thought, i think it's a limitation. Because even if I make a single trigger that merely executes it's original action (i.e. "a = a" as "Send Keyboard Shortcut") and leave everything default except for "trigger on key up", there's still too much added latency.

Testing that setup of Key=Key with the letters "I, M, A" and typing them (in that sequence) a few times results in the following outputs:

miaa
miaa
mia
iaa
iaa
miaa

Interesting how it will process the inputs out of order and even duplicate them beyond the number of original inputs.

With "trigger on key down" it seems better... but still misses a few keystrokes:

ima
ia
ia
ia
ia

... lol... as a grandmaster of useless experiments, I can report the following.

About a year ago I reversed the "normal function" of all letter keys (really all) plus special keys like Enter, Backspace ...

This means that "a" (all letters) is typed when the key is released and long press "a" does something else. As expected, this works perfectly 90% of the time. Because the "normal function" of all letters is reversed, there are no letter twisting when typing, which of course happens when one letter is typed on up and the next on down.

Because all letters are typed when the key is released, there is a slight delay when typing. But I could have gotten used to this in order to trigger another function with long press, which is really elegant if you want to work primarily with the keyboard.

In about 10% of cases, however, something unexpected happens. In my case, this was mainly in browser Vivaldi. I never understood what exactly caused it, but this 10% was so annoying that I had to abandon the experiment.

If you want to keep your fingers on the keyboard but still generate new shortcuts, then I recommend using "shift". This works flawlessly for me and comes close to the original idea. So, shift + a (short, normal) = A. Shift +a a little longer triggers something else. Your fingers stay on the keyboard and your eyes on the screen.

Edit: If you really want to use only one key, then take a look at the "reversed" short/long press method. It works flawlessly for me. The disadvantage, however, is that it is actually a key sequence, not a shortcut. This means that with a long press, the letter is still typed and has to be deleted, which can lead to unexpected problems.

What I will try out are the new keyboard blocking actions with the Space key. So, long press Space blocks the keyboard, then you can trigger something with a letter. And when you release Space, the keyboard is unblocked again. The disadvantage is that in this case Space is typed on release, which can cause the known problems.

No idea if that helps :slightly_smiling_face:

1 Like

Try with Advances Conditions.

For example, with the "A" key:

trigger: "A" short press when the focus is in a text area > action: type "A"
The advanced condition should be like this:

trigger: "A" short press when the focus is not in a text area > action: Select All
The advanced condition should be like this:

BTT is the only app (that I know of) that can recognize fields. But the other apps have to play along. Some do not provide the name of a field at all or perhaps not fast enough. So although this is actually a good idea, I doubt that it will always work reliably.

Apart from that, if I understand @proactivematter correctly, he wants the short press triggers to all do the same thing, type the normal letter. And the long press actions all do something different. In your example, you would first have to realize which field the cursor is in and then decide whether you want the short or long press action, right?

@Frank1
Thanks for the detailed explanation grandmaster Frank! I find it really awesome that we had the same idea in essence. Unfortunately upon further testing I just could not get used to that 10% either.
My objective was actually to get rid of the Shift key altogether. I wanted to capitalize letters through long press. At least for the numbers / symbols, this is achievable.

@jordikt
Thanks for the suggestion Jordikt. Unfortunately it wouldn't help my particular use case, but I understand where you are coming from. Perhaps I'll find another use for what you suggested. These new per-trigger advanced conditions are bonkers powerful.

:smiley:

Ah, that should work quite well. The lower case letters can be typed while pressing the key (short press). As normal, so that normal typing is not disturbed.

And the upper case letters when the key is released (long press). The lower case letter is also typed. But in a pure writing environment you can safely delete it. In reality here, long press is a hidden key sequence, not a shortcut. But don't worry about it.

If you want, try this. Example "i"

i = i (short press, on key down)

i = I (long press, on key up)

But ... you have to do this for each letter :hot_face:

1 Like

HOLY SHIT! That's it! That's the magical combination.

Thank you @Frank1, you are truly deserving of your title :crown:

Man, I'm so happy. This will be wonderful for coding.

1 Like

You're welcome and thank you, but I don't have any title and there are many here who know a lot more about BTT than I do :slightly_smiling_face:

Remember, the long press action is a key sequence, not a shortcut. You type something and then delete it. That could do something you don't want in the wrong environment.

To make this danger a little smaller, you can add what @jordikt suggested. Limit the long press action to certain fields with the Advanced Conditions. :slightly_smiling_face:

1 Like