Ah ok, so essentially the position of the mouse being over the menubar or not is the thing that acts as the 'modifier active' state; which you manipulate based on the key (4
) being held down?
Clever way to approach it! I wouldn't have even thought to use the mouse pointer position like that!
While I haven't tried it, I was thinking that I could also just set it up so that a 'normal' press would continue to type the key as normal, but a 'long' press/hold would then make it the 'modifier' key. I think that way the only functionality I would lose from the key is being able to hold it down for repeated keys (eg. 444444444)
Just tried it though, and it seems that even when the trigger is set up to have a minimum hold time, it still prevents the standard key from working in normal typed situations
I was thinking maybe I could just create a 2nd shortcut that triggers on a short press, as the link there suggests:
And playing around with it now.. that seems to work:
Created 2 triggers, one for the 'long press', one for the 'short press':
For the long press:
- Prevent recursive triggers
- Trigger on Key Down
- Minimum time keys need to be pressed: 1sec
And then i'm just using a Hud Overlay for the test long-press action:
For the short press:
- Prevent recursive triggers
- Trigger on Key Up
- Minimum hold time: 0sec
- Maximum hold time: 0.99sec
For the short-press action, I'm basically just having it send through the same key as my trigger, so in this case, b
:
So now, if I long-press b
, then the hud overlay is shown:
And yet I can still type b
normally, and it functions as though there was no long-press key assigned to it; at least for the most part. There seems to be the slightest bit of lag, so when I can type really fast, it ends up putting the b
1-character out of order. eg. When I am typing 'be' I can press the keys so fast that it ends up being 'eb' due to the lag. Very occasionally it also seems that it might end up doubling the letter, so I end up with 'bb' typed. So for that reason I would probably still choose not to assign it to a key I use super often in typing. But for the most part, it seems to work pretty well!
Something else I only just discovered (or maybe re-discovered), is that if I have multiple actions assigned to the same shortcut, then BetterTouchTool will show a little menu and let me choose which one I want to trigger. So for this test I just duplicated the long-press action and gave it a different description:
And now when I long-press it, I get the menu to choose which one I want to trigger:
I was also thinking that maybe we could use the 'assign value to variable' action to store the 'modifier active' state (rather than your method of moving the mouse onto the menu bar/back), but it seems that we can't read that from the 'trigger conditions' 'advanced conditions'
Edit: For this last use case, I just opened a new Feature Request:
Edit 2: So it seems that it's already possible to use custom variables in the advanced conditions!