Simulate a keyboard press while holding down a mouse button

I would like to be able to hold down the Button 3 or 4 on my mouse and have it act as if I'm pressing command on the keyboard.

The situation would be that I could just press and hold button 3 and hit the Q button on my keyboard and the app I'm in would quit (Command + Q).

Is this possible with BTT?

Try KeyboardMaestro, i think it can be done.

You can use the predefined action "CMD Down" and "CMD Up". They need to be assigned to two separate mouse triggers, one that triggers on down and one that triggers on mouse up:

Thank you both.

I ended up using SteerMouse to do it. Doesn't work perfectly but it does simulate the command key the entire time I'm holding it down and then stops as soon as I release.

Have you tried the option I described above? I'm using that with an external mouse since at least a year and it is working perfectly here.
Of course if you prefer SteerMouse that's totally fine.

I didn't try your option because I don't have enough buttons on my mouse to make it work. All my other buttons have different functions assigned to them. It's very important to me that it work with a single button (and a single click + hold).

Thanks and let me know if you think I'm missing something.

Ah I think you misunderstood. With BTT you can add the same button twice, one that triggers on mouse-down, and one that triggers on mouse up.

Now if you assign the cmd down action to the "down-version" of the button, and the cmd up action to the "up-version" of the button, it should just work fine.

1 Like

Thanks for sticking with me. That works great. I just uninstalled SteerMouse.

Thanks for making such a great product.

I'm experiencing a conflict with one of my shortcuts. I have Command + Middle Mouse Button set up to search selection in Google and I use Button 3 to simulate the Command part of it (so Button 3 + Middle Mouse Button).

When the Google search is triggered, the Button 3 (mouse-up) event is not fired and my computer thinks I'm holding down the command key until I repress Button 3.

Any Ideas? Thanks.

Uh sorry, that's a use case I haven't tried before. Probably it gets confused due to the various modifier / mouse states.

I think you could make it work by adding an additional cmd+middle mouse button that triggers on up, then send a cmd key up there. (And make the "search selected text with google" trigger on middle mouse down)

That fixed it. Incredible.