# How to map modifier keys to mouse buttons?

**URL:** <https://community.folivora.ai/t/how-to-map-modifier-keys-to-mouse-buttons/29654>\
**Category:** Configuration Help & General Discussion\
**Tags:** help\
**Created:** [December 25, 2022, 5:47pm UTC](https://community.folivora.ai/t/how-to-map-modifier-keys-to-mouse-buttons/29654 "2022-12-25T17:47:01Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![proactivematter](https://community.folivora.ai/user_avatar/community.folivora.ai/proactivematter/32/495_2.png) [@proactivematter](https://community.folivora.ai/u/proactivematter)\
**Post date:** [December 25, 2022, 5:47pm UTC](https://community.folivora.ai/t/how-to-map-modifier-keys-to-mouse-buttons/29654/1 "2022-12-25T17:47:01Z")

</div>

Hey all, I'm looking to make my mouse's scroll left / right into CMD / ALT. This can be achieved via Logitech's app, but I want to keep everything within BTT for the sake of organization. Keyboard inputs in BTT only accept the combination of a regular key+modifier and BTT preset actions only have the option of either doing modifier down or up.

I need the modifier to remain active (pressed down) until I release it. Any way I can achieve that? Many thanks.

---

<div class="post-metadata">

**Author:** ![Frank1](https://community.folivora.ai/letter_avatar_proxy/v4/letter/f/a87d85/32.png) [@Frank1](https://community.folivora.ai/u/Frank1)\
**Post date:** [December 25, 2022, 6:54pm UTC](https://community.folivora.ai/t/how-to-map-modifier-keys-to-mouse-buttons/29654/2 "2022-12-25T18:54:12Z")

</div>

> [@proactivematter](#):
>
> I need the modifier to remain active (pressed down) until I release it.

Maybe it works like this

 ![image](https://community.folivora.ai/uploads/default/original/3X/e/2/e28cf7351886e6d119eb0517bdad7e0ef311c130.jpeg)

---

<div class="post-metadata">

**Author:** ![proactivematter](https://community.folivora.ai/user_avatar/community.folivora.ai/proactivematter/32/495_2.png) [@proactivematter](https://community.folivora.ai/u/proactivematter)\
**Post date:** [December 25, 2022, 9:38pm UTC](https://community.folivora.ai/t/how-to-map-modifier-keys-to-mouse-buttons/29654/3 "2022-12-25T21:38:21Z")

</div>

That’s what I meant with the preset actions only allowing for up or down. Maybe I am missing something ? How would I go about setting this up so the mouse key behaves like a regular modifier key?

---

<div class="post-metadata">

**Author:** ![Frank1](https://community.folivora.ai/letter_avatar_proxy/v4/letter/f/a87d85/32.png) [@Frank1](https://community.folivora.ai/u/Frank1)\
**Post date:** [December 25, 2022, 9:50pm UTC](https://community.folivora.ai/t/how-to-map-modifier-keys-to-mouse-buttons/29654/4 "2022-12-25T21:50:20Z")

</div>

Mhh, I have no experience with it because I don't have a mouse.

But probably you need two actions set up with these actions

1. mouse button pressed and hold = modifier down

2. mouse button released = modifier released (Up).

This is what the manual says

## Trigger on key-down / key up

BetterTouchTool allows you to select whether you want a shortcut to trigger on key down or on key up. This can be useful if you want to e.g. trigger one action on key down (e.g. middle-mouse down using the custom click predefined action) and another action on key up (e.g. middle-mouse up).

In such a case you would just configure two shortcuts with the same keys. Then you would check the "Trigger on down" checkbox for one of them.

---

<div class="post-metadata">

**Author:** ![proactivematter](https://community.folivora.ai/user_avatar/community.folivora.ai/proactivematter/32/495_2.png) [@proactivematter](https://community.folivora.ai/u/proactivematter)\
**Post date:** [December 26, 2022, 5:56pm UTC](https://community.folivora.ai/t/how-to-map-modifier-keys-to-mouse-buttons/29654/5 "2022-12-26T17:56:08Z")

</div>

I tried this but the modifier gets permanently stuck and I have to force quit BTT.

---

<div class="post-metadata">

**Author:** ![Frank1](https://community.folivora.ai/letter_avatar_proxy/v4/letter/f/a87d85/32.png) [@Frank1](https://community.folivora.ai/u/Frank1)\
**Post date:** [December 26, 2022, 7:34pm UTC](https://community.folivora.ai/t/how-to-map-modifier-keys-to-mouse-buttons/29654/6 "2022-12-26T19:34:50Z")

</div>

Did you copy/paste an action and then change the modifier up/down? Or did you delete a modifier that you inserted by mistake? I don't know why, but that often doesn't work.

Delete both actions and set both up again. Sometimes this helps. 🤷‍♂️

---

<div class="post-metadata">

**Author:** ![proactivematter](https://community.folivora.ai/user_avatar/community.folivora.ai/proactivematter/32/495_2.png) [@proactivematter](https://community.folivora.ai/u/proactivematter)\
**Post date:** [December 28, 2022, 2:28pm UTC](https://community.folivora.ai/t/how-to-map-modifier-keys-to-mouse-buttons/29654/7 "2022-12-28T14:28:43Z")

</div>

Indeed I had duplicated it before, but I tried again just now all manual in one straight go and I am getting the same behavior - modifier will not release on key up 😕

I thought maybe I was just using these in the wrong way, but as you pointed out in the documentation, this is pretty much the exact example given. I suppose this is a bug then.

---

<div class="post-metadata">

**Author:** ![anon](https://community.folivora.ai/letter_avatar_proxy/v4/letter/a/47e85d/32.png) [@anon](https://community.folivora.ai/u/anon)\
**Post date:** [February 21, 2023, 3:27pm UTC](https://community.folivora.ai/t/how-to-map-modifier-keys-to-mouse-buttons/29654/8 "2023-02-21T15:27:44Z")

</div>

Franks solution is correct but incomplete. I think your problem is because whatever action you trigger with it held is interrupting the logic and the "up" does not fire.

You should be able to solve this by adding an additional "[Modifier] Up" action to whatever trigger(s) you you are firing while the modifier is held.

---

<div class="post-metadata">

**Author:** ![Frank1](https://community.folivora.ai/letter_avatar_proxy/v4/letter/f/a87d85/32.png) [@Frank1](https://community.folivora.ai/u/Frank1)\
**Post date:** [February 21, 2023, 4:38pm UTC](https://community.folivora.ai/t/how-to-map-modifier-keys-to-mouse-buttons/29654/9 "2023-02-21T16:38:04Z")

</div>

Hi @anon can you please explain this a bit more precisely. You mean it needs an additional "up" in the same action where you have "down"?

---

<div class="post-metadata">

**Author:** ![proactivematter](https://community.folivora.ai/user_avatar/community.folivora.ai/proactivematter/32/495_2.png) [@proactivematter](https://community.folivora.ai/u/proactivematter)\
**Post date:** [February 21, 2023, 4:50pm UTC](https://community.folivora.ai/t/how-to-map-modifier-keys-to-mouse-buttons/29654/10 "2023-02-21T16:50:20Z")

</div>

I did not have an additional trigger running concurrently (unless automated triggers from scripts running in the background count). The idea here is to be able to press the scroll wheel left or right and hold it while scrolling. So the end result would be ALT+Scroll Up/Down or CMD+Scroll Up/Down.

This is useful for many different softwares, including 3D software where there is heavy reliance on Scroll Wheel + Modifiers to navigate scenes.

---

<div class="post-metadata">

**Author:** ![anon](https://community.folivora.ai/letter_avatar_proxy/v4/letter/a/47e85d/32.png) [@anon](https://community.folivora.ai/u/anon)\
**Post date:** [February 21, 2023, 7:03pm UTC](https://community.folivora.ai/t/how-to-map-modifier-keys-to-mouse-buttons/29654/11 "2023-02-21T19:03:42Z")

</div>

Oh scrolling is going to be difficult... Because each notch of the scroll wheel is a separate input AFAIK.

I'm now also second guessing if I was even thinking of the right situation even remotely.

What I was referring to was essentially like mapping a hyperkey in certain situations. Essentially I've ran into things before where I wanted to assign an arbitrary key to a modifier key, where whatever trigger I was then activating with said false modifier key would also need an modifier key "up" to conclude the action without that modifier getting stuck down.

@Frank1

---

<div class="post-metadata">

**Author:** ![Frank1](https://community.folivora.ai/letter_avatar_proxy/v4/letter/f/a87d85/32.png) [@Frank1](https://community.folivora.ai/u/Frank1)\
**Post date:** [February 21, 2023, 7:27pm UTC](https://community.folivora.ai/t/how-to-map-modifier-keys-to-mouse-buttons/29654/12 "2023-02-21T19:27:17Z")

</div>

Mm, It may be me, but I have no idea what you mean, you just repeated what you have said before. 🤷‍♂️

---

<div class="post-metadata">

**Author:** ![anon](https://community.folivora.ai/letter_avatar_proxy/v4/letter/a/47e85d/32.png) [@anon](https://community.folivora.ai/u/anon)\
**Post date:** [February 21, 2023, 8:14pm UTC](https://community.folivora.ai/t/how-to-map-modifier-keys-to-mouse-buttons/29654/13 "2023-02-21T20:14:32Z")

</div>

Sorry, it's not you. I'm clearly struggling to put the concept into trigger-agnostic terms so I'll just give you a concrete example from personal experience instead.

I wanted Mouse Button 3 to act as CTRL+ALT+CMD+SHIFT, a sort of custom hyperkey if you will. I wanted the ability to trigger actions merely from a Left Click or a Right Click which would each require all of those same modifiers.

So I first created the following triggers and actions:

```auto
MB3 (on down) = CTRL(down) + ALT(down) + CMD(down) + SHIFT(down)
MB3 (on up) = CTRL(up) + ALT(up) + CMD(up) + SHIFT(up)

Left Click (Requiring CTRL+ALT+CMD+SHIFT) = Move Left a Space

Right Click (Requiring CTRL+ALT+CMD+SHIFT) = Move Right a Space

```

This got as far as triggering the Left Click or Right Click actions, but then upon releasing the button combination I was stuck with CTRL, ALT, CMD and SHIFT all in the down position. Obviously, pretty big problem...

The solution that actually worked was a modification of the above to the following:

```auto
MB3 (on down) = CTRL(down) + ALT(down) + CMD(down) + SHIFT(down)

MB3 (on up) = CTRL(up) + ALT(up) + CMD(up) + SHIFT(up)

Left Click (Requiring CTRL+ALT+CMD+SHIFT) = Move Left a Space + CTRL(up) + ALT(up) + CMD(up) + SHIFT(up)

Right Click (Requiring CTRL+ALT+CMD+SHIFT) = Move Right a Space + CTRL(up) + ALT(up) + CMD(up) + SHIFT(up)

```

That said, while the above did work, I ended up scrapping it in favor of a conditional logic approach. I did a little write up on the solution I settled on which you can check out here: [Mouse Chords: How to Use a Mouse Button Click as a Pseudo-Modifier for Complex Mouse Inputs WITHOUT Karabiner, SteerMouse, Maestro, Etc](https://community.folivora.ai/t/mouse-chords-how-to-use-a-mouse-button-click-as-a-pseudo-modifier-for-complex-mouse-inputs-without-karabiner-steermouse-maestro-etc/30462)

---

<div class="post-metadata">

**Author:** ![Frank1](https://community.folivora.ai/letter_avatar_proxy/v4/letter/f/a87d85/32.png) [@Frank1](https://community.folivora.ai/u/Frank1)\
**Post date:** [February 21, 2023, 8:50pm UTC](https://community.folivora.ai/t/how-to-map-modifier-keys-to-mouse-buttons/29654/14 "2023-02-21T20:50:37Z")

</div>

Ok, thanks for explaining 🙂 Now I understand.

In summary, after the action you wanted to perform, you additionally set all modifers to "up". Although that shouldn't be necessary, because they should already be on "up" by releasing the button.

If the modifiers were already "up" a second time would not hurt. And if they were still "down", the second command corrected that.

That's clever, I will try that 😀

---

<div class="post-metadata">

**Author:** ![DrSal](https://community.folivora.ai/user_avatar/community.folivora.ai/drsal/32/25821_2.png) [@DrSal](https://community.folivora.ai/u/DrSal)\
**Post date:** [April 30, 2023, 8:03am UTC](https://community.folivora.ai/t/how-to-map-modifier-keys-to-mouse-buttons/29654/15 "2023-04-30T08:03:22Z")

</div>

Your blog post describes a robust and elegant method. Thanks for posting it.

---

<div class="post-metadata">

**Author:** ![anon](https://community.folivora.ai/letter_avatar_proxy/v4/letter/a/47e85d/32.png) [@anon](https://community.folivora.ai/u/anon)\
**Post date:** [June 23, 2023, 3:49am UTC](https://community.folivora.ai/t/how-to-map-modifier-keys-to-mouse-buttons/29654/16 "2023-06-23T03:49:59Z")

</div>

Thanks for saying so! That post got zero engagement, so kind of felt like a waste of time. But, I am very glad to now know at least one person found it useful!
