aboutsummaryrefslogtreecommitdiffstats
path: root/sway/sway.5.scd
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2018-12-23 10:54:54 -0500
committerLibravatar emersion <contact@emersion.fr>2018-12-25 13:27:08 +0100
commita223030b70c8e360f81b820244705e007e3ac1ec (patch)
tree4e38abb2e27cb567760bab659546ff7176fe49fa /sway/sway.5.scd
parentsway(5): document tiling_drag (diff)
downloadsway-a223030b70c8e360f81b820244705e007e3ac1ec.tar.gz
sway-a223030b70c8e360f81b820244705e007e3ac1ec.tar.zst
sway-a223030b70c8e360f81b820244705e007e3ac1ec.zip
Change mouse buttons to x11 map and libevdev names
This modifies the way mouse bindings are parsed. Instead of adding to BTN_LEFT, which results in button numbers that may not be expected, buttons will be parsed in one of the following ways: 1. `button[1-9]` will now map to their x11 equivalents. This is already the case for bar bindings. This adds support for binding to axis events, which was not possible in the previous approach. 2. Anything that starts with `BTN_` will be parsed as an event code name using `libevdev_event_code_from_name`. This allows for any button to be mapped to instead of limiting usage to the ones near BTN_LEFT. This also adds a dependency on libevdev, but since libevdev is already a dependency of libinput, this should be fine. If needed, this option can have dependency guards added. Binding changes: - button1: BTN_LEFT -> BTN_LEFT - button2: BTN_RIGHT -> BTN_MIDDLE - button3: BTN_MIDDLE -> BTN_RIGHT - button4: BTN_SIDE -> SWAY_SCROLL_UP - button5: BTN_EXTRA -> SWAY_SCROLL_DOWN - button6: BTN_FORWARD -> SWAY_SCROLL_LEFT - button7: BTN_BACK -> SWAY_SCROLL_RIGHT - button8: BTN_TASK -> BTN_SIDE - button9: BTN_JOYSTICK -> BTN_EXTRA Since the axis events need to be mapped to an event code, this uses the following mappings to avoid any conflicts: - SWAY_SCROLL_UP: KEY_MAX + 1 - SWAY_SCROLL_DOWN: KEY_MAX + 2 - SWAY_SCROLL_LEFT: KEY_MAX + 3 - SWAY_SCROLL_RIGHT: KEY_MAX + 4
Diffstat (limited to 'sway/sway.5.scd')
-rw-r--r--sway/sway.5.scd7
1 files changed, 7 insertions, 0 deletions
diff --git a/sway/sway.5.scd b/sway/sway.5.scd
index 2fe4e372..e6abef56 100644
--- a/sway/sway.5.scd
+++ b/sway/sway.5.scd
@@ -288,6 +288,13 @@ runtime.
288 overwrite a binding, swaynag will give you a warning. To silence this, use 288 overwrite a binding, swaynag will give you a warning. To silence this, use
289 the _--no-warn_ flag. 289 the _--no-warn_ flag.
290 290
291 Mouse buttons can either be specified in the form _button[1-9]_ or by using
292 the name of the event code (ex _BTN\_LEFT_ or _BTN\_RIGHT_). For the former
293 option, the buttons will be mapped to their values in X11 (1=left, 2=middle,
294 3=right, 4=scroll up, 5=scroll down, 6=scroll left, 7=scroll right, 8=back,
295 9=forward). For the latter option, you can find the event names using
296 _libinput debug-events_.
297
291 Example: 298 Example:
292``` 299```
293 # Execute firefox when alt, shift, and f are pressed together 300 # Execute firefox when alt, shift, and f are pressed together