Designating a key to function as mouse 1 button (left click)

Hello all,

I am trying to bind a key to be a fully functional replacement for left click. Initially I thought it would be a simple keyboard shortcut trigger where I assigned left click (with modifier keys) to trigger when I click the key, but I've ran into a few issues, as follows.

First off, if I try to hold any modifier key when I click trigger key, it no longer recognizes it as that key command (as I'm now inputting a different combination of keys). This means I can't for example, use the key click to command + click on links to open in new tab in browser, or alt+click with the key in spreadsheets to use special drag features.

Speaking of dragging, I also cannot use it to click and drag, as it's a discrete click. Thus, I tried using the combination of custom click - left click down triggered on key down, and left click up triggered on key up, but the issue I ran into there is it ignores modifier keys, and as before, if I'm holding a modifier key when I click ` , it doesn't recognize it as the proper shortcut and does not trigger click at all.

I tried a work around where I set up the key down trigger to be custom left click - left mouse button down, and then the release of the key to function as a left click with modifier keys: that works in the sense that if I press and hold the key, then add a modifier key, then release, I can click with modifier keys, but it's still a less than ideal solution for a couple reasons. First, it's functionally a double click. Secondly, I can't just hold a modifier thing and click on things- I have to press the key, add the modifier key, and release, for the same reason I detailed above.

I also tried a workaround where I used the key to trigger a mouse drag on key down and release the mouse drag on key up, which works to some extent, but again, I cannot hold a modifier key on the initial keypress, I have to add it after, and before key release, and this also removes the ability to double or triple click things, which is something I do frequently to highlight things if I'm copy pasting etc. I tried to do this adding a left-click a bunch of different places in the sequence, but basically any combination of mouse drag followed by mouse drag release results in losing the ability to multi-click.

So my question is: is there any way to do this currently? Or should I submit a feature request?

From my exploration, I think the most elegant way to solve it would be to add the ability in the "other configuration section" to remap keys directly to mouse buttons.

Another solution could be to add a custom left click that respects modifier keys, but I don't think that would solve the issue where holding a modifier key when you click a key shortcut is not recognized as that shortcut because you are holding additional keys- there would have to be a way to instruct BTT to trigger a shortcut if a key shortcut is pressed, regardless of what other keys are pressed simultaneously.

Anyways, any help would be super welcome! I've spent upwards of 8 hours on this now, and digging around similar topics I've found no solutions.

Thanks,
music

I'm not fully sure I understand the issue with this. Why is it functionally a double click?

Here is an example where I have configured it for the minus key:

You would need to record any combination of modifier keys that you want to use. It should only act as a double click if you press the key twice.

Hi Andreas,

The reason what I described is functionally a double click is because what I described was binding a key to perform a custom left mouse button down on key down, and then a "left click (with modifiers)" on release. Which effectively hits the mouse button down twice and releases it once, which got interpreted as a double click by the computer when I tested it. Of course, the problem with using custom left click for both is it ignores modifiers.

As for the response- yes I understand that I could make a key command for every single combination of modifier key I would want to use, but given I want to use any and all possible commands, that felt really clunky and annoying since there are 5 modifier keys.. which means doing that would require me to create 30+ commands, which is rather tedious and annoying.

It sounds like a feature request of being able to rebind keys to mice buttons in the "other" section is the only way to do this easily though.

-music

BTT can only low-level rebind keyboard keys to other keyboard keys, that's because it uses a system functionality for this.

However I could add an option for the "Custom Mouse Buttons & Modifiers" action to "include currently pressed modifier keys", then you could configure it yourself without configuring every combination.

You would not send a standard left-click on key-up, instead you'd send a left-click (only mouse up) via the "Custom Mouse Buttons & Modifiers" action, like in the screenshot above.

Hi Andreas,

That would be fantastic! Would that get around the issue where BTT doesn't recognize a modifier key + regular key as the same command as the regular key alone? Or if not, would it be possible to add an advanced setting that would allow a key command to trigger whenever the key (or combination of keys) is pressed, even if other things are pressed at the same time?

Thanks,
music

You can not use a keyboard shortcut for that, but you can use the key sequences feature. I'll post an example later. (Shortcuts on macOS always trigger for a specific combination of modifier keys + a standard key)

Which key would you like to use as mouse button key? (I can post a example preset for that then)

Hello Andreas,

I was planning to use ` , and to duplicate it on \ !

Thanks for your help,
music

Ah, forgot to ask: What is your system language/keyboard layout?

Hi Andreas,

My keyboard is English U.S. (QWERTY). I think I figured out the implementation using the key sequences function! All I need now is a custom left click action that accepts modifier keys.

Thanks,
music

Can you try this preset with the 5.272 alpha?

accentclick.bttpreset (5.4 KB)

It does two things:
1.) In the "Automations, Named & Other Triggers" section it remaps "grave accent and tilde to no key" - in order to prevent the default function of that key
2.) In key sequences it configures the required clicks on key down and key up.

Hi Andreas,

I tested it and that works. Thank you so much for all your help!

-music