Control MPlayer using the mouse only

MPlayer is the only player I use. MPlayer supports almost any format you may need; if you want to watch a movie or show episode it has simple ui that let you do exactly that and no more, so no distractions. If you want to work on more complex tasks involving audio or video MPlayer and MEncoder also offer powerful features that I prefer not to discuss but that I encourage you to read about them if you’re interested.

One thing that was bothering me is that when I was watching a movie and I was away from my computer I had to go near the laptop to do things like pause the video or change the volume level. I could avoid this using a wireless keyboard but I don’t want to buy one. However, I do own a wireless mouse and it would be great to be able to use it to control MPlayer.

The gist below allows you to pause/play the reproduction with a click of the mouse left button, toggle fullscreen with mousewheel click and control the volume with a combination of clicking and holding the right button while scroll up or down.

Add this to a file input.conf placed in the ~/.mplayer/ directory.

If you have a mouse with more buttons you can get a full list of supported button names by running mplayer -input keylist and a full list of available commands by running mplayer -input cmdlist.