Linuxの場合です
デバイスidを調べる
xinput list
Kensington Expert Wireless TB Mouse <- 2.4Ghz無線 ExpertBT5.0 Mouse <- Bluetooth
マウスボタンのidを調べる
xev -event mouse
デフォルトのボタン配置
+----------+----------+ | 2:Middle | 8:Back | +---------( )---------+ | 1:Left | 3:Right | +----------+----------+
変更その1
xinput set-button-map 13 8 3 1 5 4 6 7 2 9
ホイールスクロールは 4/5 を入れ替えている・・・のだが反映されない(ので実は設定マネージャーで変えている)
変更後
+----------+----------+ | 3:R | 2:M | +---------( )---------+ | 8:Back | 1:L | +----------+----------+
変更その2
xinput set-button-map 13 2 3 1 4 5 6 7 9 8 & # Kensington 2.4Ghz
変更後
+----------+----------+ | 3:R | 9:Fwd | +---------( )---------+ | 2:M | 1:L | +----------+----------+
9はxbindkeysで ^Home に割り付けている(後述)
# xbindkeys/xteで任意のマウスボタン(キー)で任意のキーストロークが動くようにした(Keisingtonトラックボールのボタンをカスタムした) - Lambdaカクテル
# https://blog.3qe.us/entry/2017/11/13/190000
sudo apt -y install xbindkeys xautomation
cat <<'...' >~/.xbindkeysrc
"xte 'key Home' &"
b:8
...
# xprofile - ArchWiki
# https://wiki.archlinux.jp/index.php/Xprofile
[ -s ~/.xprofile ] || cat <<'...' >~/.xprofile
#!/bin/sh
# vim: set ft=sh ff=unix expandtab ts=2 sw=2 : # modeline'
xinput set-button-map 13 2 3 1 4 5 6 7 8 9 &
xbindkeys &
...