Mouse Macros Are So Powerful

| Apr 29, 2023

Sasa

Thrift market, again! This time I brought home an item I’ve been looking for so long: the Elecom Huge Trackball mouse. I was so lucky to find it new at a fraction of the price. What a strike!

The mouse itself might seem a bit intimidating, because of its shape and dimension, but is so damn comfortable! Even more than a Kensington Expert or a Logitech M570. It has some flaws, like the famous bearing’s friction problem, the scroll wheel feels a bit meh and the switches aren’t clicky as I like. But all these things can be modded with less than 10 bucks and a lot ot patience. Although today we are focusing on something else: how I integrated such a mouse in my Debian to make macros and speed up my workflow. As lazy as I am, I found a very simple solution that can be replicated on any distro and, potentially, by using equivalent softwares, on Windows.

The first piece of software you need is called Input Remapper. This program basically allows you to remap your mice’s input (or any other peripheral) per your likings. I tried with other methods, using my terminal and changing config files, but I found it to be frustrating, time consuming and very much prone to errors. Input Remapper has a nice and intuitive GUI, allowing the user to track and map your input very quickly, paired and customized to each and every peripheral. You can even create different presets and changing them on the go. Installing to install it on Debian, open your terminal and paste:

sudo apt install git python3-setuptools gettext
git clone https://github.com/sezanzeb/input-remapper.git
cd input-remapper && ./scripts/build.sh
sudo apt install ./dist/input-remapper-1.5.0.deb

You are done, now you can just open the app and start to fidget with the GUI. The process is pretty straight-forward: you select the device you want to remap from the top menu, click on the change key, press the key you want to map and then write the new keystroke in the text-box.

Input Remapper GUI

You can see all the possible commands on the official docs.

Some significant keys I have remapped are the Button EXTRA and the Button SIDE, respectively to copy and paste the selected string, using:

modify(Control_L, key(c))

and

modify(Control_L, key(v))

Also, one of the cool features of this trackball, is that the scroll wheel can “bend”, having a Wheel Left and Wheel Right, remapped to scroll horizontally with:

wheel(left, 20)

and

wheel(right, 20)

The other useful remap is on the outermost right button, named Button TASK. Here I call a chord of CTRL, Shift and Home with

hold_keys(Control_L, Shift_L,Home)

This exotic combination is used as a shortcut to open the other software I’ve started to use: Gnome Fly-Pie! Gnome Fly-Pie is not really a stand-alone software, is just a Gnome Extension that allows the user to create, customize and use multi-level radial menus. You can associate a keystroke to a specific menu and, as you navigate through it, you can access to your most used apps and commands with just a couple of clicks. Depending your usual tasks, this exension is a help from above, as you can invoke commands, open app and links, access to your clipboard and so many other things, packed with a very intuitive and friendly interface. Also, the menu is already pleasant and neat, but also aesthetically customizable, which is a good plus!

Of course, both Input Remapper and Gnome Fly-Pie offer a way to export your configuration in a JSON file, to migrate the settings across all your machines. What more can you ask?

This system is still on evaluation and open for improvements, but basically I’m very close to my nerdvana, by reducing the movements to and from the trackball, speeding up my workflow and gaining a bit of comfort.

Happy building ⚒

comments powered by Disqus