Mouse & Keyboard

One of the very last things I would've though of when I switched from OS X to Linux Mint (LMDE) was the fact that I might face some shortcomings regarding keyboard and mouse…
Maybe was I so faithful that the Linux World certainly had faced that question long before I decided to join it, or was I so innocent to forget about the importance it has to be able to choose the one input device that really suits you?
The fact is that the only keyboard that I never ever could use with my mac-lmde system has been my dear genuine Apple Extended bluetooth keyboard. I've been using it for about 7 years at the time, and couldn't imagine using something else.

Although today, the text that you're reading wasn't input through this beloved keyboard. I'm using a brand new, backlit, Logitech K800… With pleasure!

To cut a long story short, when I initially installed Linux Mint Debian Edition, I just didn't know I would stay in this world for so long (forever?). So I just installed LMDE on an external HD and booted from it. At that time I used an Apple Extended Bluetooth Keyboard and an Apple Bluetooth Magic Mouse.

Starting to work with LMDE quickly showed me that, even if there was absolutely no problem using my Apple bluetooth Magic Mouse, the bluetooth keyboard never could get paired with my system.

From there on, I started considering getting some new I/O gear since I was anyway exploring new grounds!
As I had no other keyboard available, I started with an attic retrieved first generation iMac USB keyboard (you know… that green egg). It worked OK but wasn't exactly the most enjoyable experience on the long run.
Then, I went to the computer store with only a few € in my pocket and bought a (cheap) Logitech K120 basic business keyboard. That felt already better. Once again: no problem configuring it on LMDE; do I have to mention that I'm using a belgian layout keyboard which is not always supported?

OK, enough of that, I dreamt of a Logitech K800 back-lit keyboard along with a Performance MX mouse…
Since Christmas has just passed, guess what Santa Claus brought me?
You got it!

Keyboard

As already stated, I don't think you'll ever have to face a problem plugin a keyboard into an LMDE system. Except for the fact that some bluetooth gear might not work, any USB keyboard I've plugged in was perfectly usable. It might take you a little time to figure out what layout is the right one in the “Menu > Control Center > Keyboard > Layout” panel, but ultimately I must say I didn't find a keyboard that I couldn't map in LMDE.

Mouse

Well, some would say that a mouse is a mouse… That's right you plug it in the USB connector and it drives your pointer on the screen. But what about the scroll button (or sensor), and horizontal scrolling?
There also, most any mouse I plugged into LMDE reacted as expected. Sometimes they would be too sensitive and jump from one side of the screen to the other (a DPI problem probably), b ut I could get acquainted to all of them and LMDE understood them well enough to allow me to work correctly.

Then came the Logitech Performance MX. The mouse I had been dreaming of for a long time… But what about it's adjustable sensitivity, and the “free wheel” scrolling or it's 7 buttons ?
Would Linux offer a way to take advantage of all these bells and whistles?

I'm about to say: YES!

Although Logitech doesn't offer a genuine Linux driver for it's Unifying Receiver devices, the community mitigates this problem, specificaly the Solaar Project brings a fully functional solution to using such devices on your Linux machines.

Normaly the logitech-djreceiver driver should already be enabled and loaded, you can check on that by typing viewing dmesg right after pluging in the unifying receiver, it should output something like:

dmesg
[21449.244283] usb 1-1.1.2: new full-speed USB device number 11 using ehci-pci
[21449.357947] usb 1-1.1.2: New USB device found, idVendor=046d, idProduct=c52b
[21449.357955] usb 1-1.1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[21449.357959] usb 1-1.1.2: Product: USB Receiver
[21449.357962] usb 1-1.1.2: Manufacturer: Logitech
[21449.368092] logitech-djreceiver 0003:046D:C52B.000F: hiddev0,hidraw5: USB HID v1.11 Device [Logitech USB Receiver] on usb-0000:00:04.1-1.1.2/input2
[21449.371256] input: Logitech Unifying Device. Wireless PID:101a as /devices/pci0000:00/0000:00:04.1/usb1/1-1/1-1.1/1-1.1.2/1-1.1.2:1.2/0003:046D:C52B.000F/input/input18
[21449.371521] logitech-djdevice 0003:046D:C52B.0010: input,hidraw6: USB HID v1.11 Mouse [Logitech Unifying Device. Wireless PID:101a] on usb-0000:00:04.1-1.1.2:1

Also, the udev package must be installed and the daemon running, which is probably the case since it's the /dev/ and hotplug management daemon… You'd already have noticed if it wasn't there ;-)

Create a file solaar.list in /etc/apt/sources.list.d/, with the following contents:

sudo nano /etc/apt/sources.list.d/solaar.list

deb http://pwr.github.io/Solaar/packages/ ./
deb-src http://pwr.github.io/Solaar/packages/ ./

Then update your packages descriptions and install:

sudo apt-get update
sudo apt-get install solaar

Solaar is now accessible through the “Applications > Accessories” menu.
One noticable thing is that, at first, I blindly enabled the “Smooth Scrolling” option that Solaar presented for my Performance MX Mouse. Just to discover that it made the locked wheel scrolling jump one page at a time and not allow any subtle scrolling movement anymore. Only the free wheel would allow me to, more or less, control the scrolling behavior. Un-checking that option brought me back to what I initialy expected from the scroll wheel.

As I stated earlier, my Logitech Performance MX mouse has 7 buttons… What the hell could I use them for?

Download Easystrokes from sourceforge.
Let's say we downloaded that archive to our ~/Downloads directory.
We need to extract the archive, install a few dependency libraries and make the application. Easy!

cd ~/Downloads/
sudo apt-get install g++ libboost-serialization-dev libgtkmm-3.0-dev libxtst-dev libdbus-glib-1-dev intltool
tar xzf easystroke-0.6.0.tar.gz 
cd easystroke-0.6.0/
make install

You should now find the Easystroke application uner “Menu > Applications > Universal Access > Easystroke”

Easystroke usage

It wasn't immediately obvious for me to figure out how to use Easystroke. My first, simple, objective was how to “map” the “thumb down” button of my mouse to an action.

First off, while the Easystroke window is displayed, head over to the “Preferences” tab and activate the “Autostart easystroke” check box, so that Easystroke will always be active upon startup. Selecting “Show tray icon” is also interesting if you want a quick way to access the application from the menu.

Additionally, you can also specify certain windows as “exceptions” and the mouse movements will not be recognized as gestures when working within those windows. Specifying an exception is easy, all you have to do is click on “Add Exception” and then on the window. It will then be added to the exception list.

Next up, you need to create gestures and configure them to run custom commands. Go to the “Actions” tab, click on Add Action, provide your gesture with a name, click on type. You can then choose from amongst the different actions that you can perform with the gesture. You can run a command, send a keystroke, scroll a page and more. Then provide the detail for the type you chose. Click on “Record Stroke” and using the keys and mouse button you created above draw the stroke on the screen. That’s it you are done. The next time you draw a similar stroke again with Easystroke running the configured action will be executed automatically.

One of the best invention next to the keyboard and mouse are the application launchers. They avoid you going through countless icons and windows to reach the application / folder / document that you're looking for.

There are a few packages available that offer this kind of functionality, one of the first to go for would be Synapse if we weren't going for Albert.

Alternatives would also be Kupfer and GnomeDo.

Installing Albert

Kind of disappointing is that the Albert's GitHub page is only offering the compile from source option for Debian, thus LMDE2, systems. So we'll have to go that way…

First we make sure that we're using Qt version > 5.3, as it is stated that below this Qt version there are known problems with Albert.

> qmake --version
QMake version 3.0
Using Qt version 5.3.2 in /usr/lib/x86_64-linux-gnu

We'll also make sure all required libraries are available:

> sudo apt-get install g++ cmake qtbase5-dev libqt5x11extras5-dev libqt5svg5-dev libqt5sql5-sqlite libmuparser-dev

Then download the GitHub master version, put it in /opt and compile:

> sudo su
Password:
> cd /opt
> wget https://codeload.github.com/ManuelSchneid3r/albert/zip/master
> unzip albert-master.zip
> cd albert-master
> cmake . -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
> make [-j 6]
> make install

note: the -j 6 option is here to let make use multiple processors. This will greatly reduce compile time and should be tuned to your available cores of course.