Add modifier keys and other keyboard keys to 'Advanced Conditions' in 'Trigger Conditions'

Continuing on from my 'Edit2' discovery above.

We can use an action on the 'long-press' trigger to assign a value to a variable (eg. isBLongPressed):

image

And then read that variable in the 'advanced trigger conditions' of a different trigger:
image

image

We would also need to make sure to 'unset' our variable when the B key is released, so putting something like this in a 'key up' trigger:

image

I originally tried having 2 'short-press' shortcuts configured on 'key up', the first with the min/max hold time as shown in my previous message, and the second that had no max hold time; but having 2 shortcuts set up (even with the different hold times) resulted in the 'which one did you want to run' menu being shown.

I then tried just having the 'short-press' shortcut without min/max time on 'key up', which worked well, but resulted in an extra b being typed when using my long-press shortcut, which wasn't ideal.

I was thinking maybe I could be 'extra tricky' and configure a 3rd action so that I have:

  • Long-Press (key down, min hold 1 sec): set isBLongPressed = true
  • Short-Press 1 (key up, min hold 1 sec, no max hold): set isBLongPressed = false
  • Short-Press 2 (key up, no min hold, max hold 0.99sec): send B key and set isBLongPressed = false

Screenshot 2023-01-24 at 8.21.51 am

My theory with this was that it should prevent the extra B being sent through on a long press, since the only way that the B is being 'typed' is by 'Short-Press 2', so if it's configured not to run when the key has been held for the 'long press time', then it shouldn't trigger. Though unfortunately in my testing, this was still triggering.. so it might be a timing issue (0.99sec being too close to 1sec), or it might just be a bug in BetterTouchTool; not sure.