generate back and forward keyboard events from two-finger swipes left and right
openbsd
at main 35 lines 1.1 kB view raw view rendered
1# tpadnav 2 3OpenBSD's 4[wsmouse (wstpad)](http://man.openbsd.org/wsmouse) 5driver for touchpads recognizes two-finger scrolling left and right and 6generates mouse button 6 and 7 events (as well as 4 and 5 for scrolling up and 7down). 8 9This program listens for those mouse button 6 and 7 events and then generates 10fake `XF86XK_Back` or `XF86XK_Forward` keyboard events with the `XTest` 11extension. 12In at least Firefox, this effectively enables left and right two-finger swipe 13gestures on a touchpad to navigate backward and forward. 14 15Since these button events are generated many times along a two-finger swipe, 16this program throttles its output and only generates one back or forward key 17per 750 milliseconds (configurable with the `-i` option). 18 19## License 20 21ISC 22 23## Compiling 24 25Run `make` to compile, and `make install` to install to `/usr/local` by 26default. 27 28## Usage 29 30Add `/usr/local/bin/tpadnav &` to `~/.xsession`. 31 32If the 1 second throttling is generating more events than you want, try a 33higher `-i` value (in seconds). 34 35If it's not doing anything, run it with `-v` to see verbose output.