mouseless

The time needed to 1) grab a mouse; 2) move it; 3) click; and 4) go back to keyboard could be often spent more productively. From personal experience, the ability to use keyboard shortcuts could save decent amount of time. Sometimes, however, it seems that there is no other way other than to perform the mouse movement and click. This happens mainly because there is no keyboard shortcut to fulfill the desired behavior.

mouseless is a small python script, which enables fast movement of mouse cursor by successive division of screen. In effect, one can reach every pixel in small number of steps (logarithmic in size of screen) by using adequate keys on numeric keypad. An example of process of division is shown on the following video.

The video shows an use case, when one wants to close an interpret (e.g., after crash). In spyder (very nice interactive python development environment) does not seem to be shortcut to do so.

mouseless currently works under linux only. mouseless is not (yet) directly installable from packaging system, but you should be able to easily run it. To use mouseless, you need to have the following dependencies on your computer:

  • python
  • xdotool
  • python-qt4

On debian-based distributions, this command should do the job:

sudo apt-get install python xdotool python-qt4

The only remaining thing to do is to download mouseless.py (temporary location; will be moved to github) and run. Add execution rights for the file:

chmod +x mouseless.py

Then it should be possible to run mouseless. By using numerical keyboard (1–9), one will select desired screen section; then the section could be divided again and so on. In most cases, 4 key presses are enough. The program ends when user hits the Enter or Return key. If incorrect selection was performed, Backspace could be used to go to the previous one.

To utilize the system, there is need to attach keyboard shortcut to run mouseless and perform mouseclicks (e.g. in Ubuntu). What remains to do is to perform the mouse click at given position. We can do so by attaching the keyboard shortcuts to xdotool commands:

xdotool click 1
xdotool click 3

The former performs the left click, the latter the right click. Just in case, my configuration of shortcuts is as follows:
Ctrl + Alt + Q (run mouseless)
Ctrl + Alt + A (left click)
Ctrl + Alt + D (right click)

There are still some limitations, where mouseless would not help (e.g., enlarging a window), but in practice, it reduces the use of mouse to some degree. 

Enjoy being more mouseless!

One thought on “mouseless

Leave a comment