# gpui: Handle Swipe events to support navigation buttons on some mice \(\#23332\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/d2828e87228125820f570c894cad4fd436fc9e10)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: d2828e87228125820f570c894cad4fd436fc9e10

Requested commit: d2828e87228125820f570c894cad4fd436fc9e10

Commit: d2828e87228125820f570c894cad4fd436fc9e10

Tree: c1fa4afef99226dd499156045577306212611a30

Author: Szymon Piechaczek

Committer: GitHub

## Message

```
gpui: Handle Swipe events to support navigation buttons on some mice (#23332)

Closes #14170

To fix this, Zed needs to handle swipe events on its NSView. Logitech
mice don't send the usual Mouse4 and Mouse5 buttons but emulate swipe
gestures according to these websites:
- https://superuser.com/a/1216049
- https://sensible-side-buttons.archagon.net/

Of course, the user can map these buttons to something else in the
device's driver. Most IDEs (VSCode, IntelliJ) handle that correctly by
default so it would be good to follow that pattern.

Since it's my first contribution here, please let me know if I need to
enhance this PR to make it good enough for the main branch.

Release Notes:
 - Fixed mouse navigation buttons on some devices (Logitech, Mac OS)
```

## Parents

- [d1b8fedc9c230bc25f89c7574dd5515435c8f784](https://git.cafe/gitcafe/zed/commit/d1b8fedc9c230bc25f89c7574dd5515435c8f784?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/d2828e87228125820f570c894cad4fd436fc9e10?format=markdown)
