# Wayland+libinput: remap mouse buttons

**URL:** https://discourse.nixos.org/t/wayland-libinput-remap-mouse-buttons/54659
**Category:** Help
**Created:** [October 20, 2024, 9:38pm UTC](https://discourse.nixos.org/t/wayland-libinput-remap-mouse-buttons/54659 "2024-10-20T21:38:19Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![lostmsu](https://discourse.nixos.org/user_avatar/discourse.nixos.org/lostmsu/32/26384_2.png) [@lostmsu](https://discourse.nixos.org/u/lostmsu)
#### Post date: [October 20, 2024, 9:38pm UTC](https://discourse.nixos.org/t/wayland-libinput-remap-mouse-buttons/54659/1 "2024-10-20T21:38:19Z")

</div>

My Logitech M510 has its side buttons swapped (probably 4 and 5, I’m used to the one closer to wrist being “Browser Forward” and the other one “Browser Back”, but on M510 they are reversed).

How can I configure my system to remap them the way I want?

If possible - only for this mouse model.

---

<div class="post-metadata">

### Author: ![bew](https://discourse.nixos.org/user_avatar/discourse.nixos.org/bew/32/2091_2.png) [@bew](https://discourse.nixos.org/u/bew)
#### Post date: [October 21, 2024, 9:03am UTC](https://discourse.nixos.org/t/wayland-libinput-remap-mouse-buttons/54659/2 "2024-10-21T09:03:22Z")

</div>

There are a number of low-level remapping tools on Linux:  
[https://wiki.archlinux.org/title/Input\_remap\_utilities](https://wiki.archlinux.org/title/Input_remap_utilities)

I’m personally using [`interception-tools`](https://gitlab.com/interception/linux/tools) to remap some keys with dual-functions (when tapped vs pressed with another key).

I know that program can detect specific hardware and launch a specific remap pipeline, but it might be a bit too flexible for such a simple key-to-key remap.  
Other tools like [`xremap`](https://github.com/xremap/xremap) (not specific to X11) could be simpler than for your usecase 🤔
