Skip to content

Instantly share code, notes, and snippets.

@grafov
Created April 3, 2021 14:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grafov/3bd5bb0ee03e4549ca70e63959b6df4b to your computer and use it in GitHub Desktop.
Save grafov/3bd5bb0ee03e4549ca70e63959b6df4b to your computer and use it in GitHub Desktop.
Configuration for the remapping Kensington Expert Mouse buttons for Sway WM
# Copypaste it to your ~/.config/sway/config
set $TBALL 1149:4128:Kensington______Kensington_Expert_Mouse
# Turns on scrolling with the ball when right bottom button pressed.
input $TBALL {
scroll_method on_button_down
scroll_button 273
}
# Remapping swaps upper and bottom rows of the buttons.
# By default buttons work this way:
# MIDDLE SIDE
# BALL
# LEFT RIGHT
#
# After remapping it could be used as:
# LEFT RIGHT
# BALL
# MIDDLE RIGHT
bindsym --input-device=1149:4128:Kensington______Kensington_Expert_Mouse --whole-window BTN_LEFT seat seat0 cursor press BTN_MIDDLE; seat seat0 cursor release BTN_MIDDLE
bindsym --input-device=1149:4128:Kensington______Kensington_Expert_Mouse --whole-window BTN_MIDDLE seat seat0 cursor press BTN_LEFT; seat seat0 cursor release BTN_LEFT
bindsym --input-device=1149:4128:Kensington______Kensington_Expert_Mouse --whole-window BTN_SIDE seat seat0 cursor press BTN_RIGHT; seat seat0 cursor release BTN_RIGHT
bindsym --input-device=1149:4128:Kensington______Kensington_Expert_Mouse --whole-window BTN_RIGHT seat seat0 cursor press BTN_SIDE; seat seat0 cursor release BTN_SIDE
@aryklein
Copy link

Awesome. How do you know that right bottom button is 273?

@aryklein
Copy link

Never mind. I think you got it using sudo libinput debug-event

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment