Use number of fingers touching the trackpad as modifier for keyboard shortcuts

The latest BTT alpha (3.840) adds a new feature called "Advanced Trigger Conditions".
One of the conditions is the number of fingers touching the trackpad or magic mouse.

This can be used to setup keyboard shortcuts that trigger different things, depending on the number of fingers touching the trackpad or Magic Mouse.

Here is an example that keeps the standard functionality of CMD+A if neither two nor three fingers are touching the trackpad. If two fingers are touching the trackpad it executes Mission Control and if three fingers are touching the trackpad it executes the Launch Pad action

1.) Define standard cmd+a that continues to trigger the standard macOS "select all". To do this, record the CMD+A shortcut, then assign an action that just sends cmd+a again. However make sure to click the "Prevent recursive triggers" option.

2.) Click the "Advanced Conditions" button.

3.) Configure the conditions for this default case. It shall trigger if neither two nor three fingers are touching the trackpad:

4.) Now configure the other cmd+a shortcuts and assign some actions to them. However for these assign different conditions:

5.) Done! Now the shortcut will do different things depending on the number of fingers touching the trackpad.

@Andreas_Hegenberg I have just tested this. So far it works well. Thanks Andreas, a really good idea! :smiley:

However, I think the true benefit of this function is not apparent from your example. ⌘+a+finger. In my opinion, the finger on the trackpad is the modifier.

1 finger on the trackpad + a = action.

No finger on the trackpad a = a

This seems to work fine. Many better than with the short/long pressed function because letters are written on down, not on release.

One last thing: Unfortunately it works better with the index finger than the thumb. If I have all fingers on the keyboard and put the thumb on the trackpad (so 1 finger = thumb + a) it works poorly. Do you think you could improve this?

1 Like

There are also many other things that will become possible using these new trigger conditions:-)

Probably you have the thumb recognition/ filtering enabled in the BTT trackpad settings- but I agree I’ll disable that for this feature.

I am sure of it and I will discover them all :slight_smile:

I have it disabled now, but now really EVERYTHING is detected, so the slightest touch triggers something which is why even more errors happen.

My suggestion would be that the thumb is only detected in the top third of the trackpad (äh not the Handballen :rofl:.) But the thumb more extensive, because not the fingertip is applied. Would that be a possibility?

1 Like

It should already be similar to this when thumb recognition is enabled, the higher up, the less aggressive the thumb filtering should act. I’ll check whether maybe something is preventing that here

Ich muss das deutsch schreiben :slight_smile: Das Problem scheint, dass der Daumen grossflächig aufgelegt wird, wenn die anderen Finger auf den Tasten sind. Der Daumen wird deutlich besser erkannt, wenn nur die Fingerkuppe aufgelegt wird. Das ist aber schwierig, wenn die anderen Finger auf den den Tasten bleiben sollen... äh, versteht man das :joy:

ja BTT erkennt an der „Form“, dass es der Daumen ist und filtert ihn dann ggf. weg - für die meisten Gesten macht das Sinn. Wenn du nur die Spitze benutzt sieht es für BTT aus wie jeder andere Finger.

Ich schaue mal wie ich das für diesen Fall optimieren kann, den Code habe ich nur schon 10 Jahre nicht mehr angefasst :joy:

10 Jahre? Dann viel Spass :rofl: :joy:

Stell dir vor, wie der linke Daumen zur linken ⌘-Taste geht, wenn alle anderen Finger auf ihren Tasten bleiben, also linker Zeigefinger auf „f“, linker Mittelfinger auf „d“ usw. Der Daumen liegt dann seitlich, grossflächig am obersten Rand des Trackpads.

Wäre toll, wenn das so gut funktionieren könnte. Dann ist das Trackpad wirklich wie ein modifier :+1:

looking at the code I believe I might never have implemented thumb recognition for the left hand correctly - can you confirm it works better with the right hand?

I'll check what adjustments to make to get it to work with the left hand as well.

I haven't been able to try it out for long enough to confirm that. But for such things I mainly use my left thumb / hand :man_shrugging:

In 3.843 I added another variable "thumb_recognized", I think that might fit your use case better.

Ok, thanks, but where is it? I have not found anything in the settings

it's in the condition configuration

However for me relying on the thumb would cause too many accidental triggers (as I rest my thumb on the trackpad a lot), the example above with two or three fingers works really good here.

Unfortunately, that doesn't work at all. When triggering with the finger (thumb) BTT shows me a conflict palette with the two actions.

  • letter only
  • Action with finger and letter from trackpad.

I can't take a screenshot of it unfortunately.

that happens if both your default A and the one with the condition fulfill all their requirements/conditions. The default one would need a condition to not be active when a thumb is recognized

Ah, clever, I'll try that right away.... :grinning:

Not bad at all, after the first tests. Much better than before. But the laterally aligned thumb must be completely on the trackpad. But usually the top of the thumb is a bit above the edge of the trackpad, closer to the spacebar. Not to be impertinent, but could you improve on this? :pray:

if I understand correctly, this most likely can not be fixed because BTT still needs to filter accidental touches. At some point it's almost impossible to differentiate accidental touches vs thumbs on the edge of the trackpad

Maybe you can take a screenshot or video of the live view (View => Show Live View) so I can see how exactly you are touching it :-). However you'd need to disable thumb recognition to see the details in live view

Ok, I have made the screenshot below... :rofl: But it really works not bad. I just have to get used to putting my thumb in the trackpad a bit more. So, if you can improve it, I'm very happy. If not, I can live with it.

Have you improved the thumb thing significantly recently, or is that just my impression? :wink:

Anyway, with the left thumb on top of the trackpad: PERFECT! Zero errors.

Unfortunately, the right palm occasionally triggers something wrong on lower part of the trackpad. Is there no way to filter out the palm for the lower part of the trackpad? Thanks!

This setup gives me the best results:

Trackpad + letter

Letter only

Would you do it differently?