Simple utility for sending keystrokes with xdotool when the mouse is flicked in a certain direction. For example for switching virtual workspaces.
delay
how long (in milliseconds) to wait before reading the mouse position againthreshold
how far (in pixels) must the mouse move for the flick to be detected
Assuming you have installed SFML, run:
c++ main.cpp -lsfml-window -lsfml-system -o mouse_flick
Add a shortcut in your system settings which launches the binary mouse_flick
(make sure it's executable).
You might want to copy it to your PATH
directory for convenience.
I use Super+D
because my mouse has a button which sends it
Now press the button/shortcut and quickly move your mouse up, down, left or right to send keys. You can modify the sendKeys()
function calls to suit your system's shortcuts, or replace them with system()
to execute your own commands.