Using the Computer Without a Mouse

July 08, 2020

Often, I hate using the mouse.

Mice are a great input medium, in many respects. For things like editing pictures or dragging-and-dropping, the mouse is invaluable. And often, it’s nice to just kick back and use a computer with a single hand.

Yet, for much of what I do on the computer, the mouse is unnecessary—even a hinderance. Interfaces that should require a quick, simple search turn into cascading alluvials of radio checkboxes, selectable elements and lists. They take time to look though. We can debate whether using keybindings is faster than a mouse, but surely the perceived cognitive overhead is lower. For me, this lower overhead translates to a smoother experience.

Microsoft Windows is, at least at first glance, the most hostile major operating system for keyboard users. Indeed, many of the issues I have with Window’s UI simply aren’t solvable. An easy example: non-searchable drop down menus. Fortunately, we can still navigate these without touching the mouse by using alt.

In this post, we’ll cover some tools that make using Windows without a keyboard a much smoother experience.

AutoHotkey

AutoHotKey is a powerful, ubiquitous Windows scripting language for creating keyboard macros and bindings. I’d say it’s essential for any keyboard-user. Many Windows power users are familiar with AutoHotKey, so I won’t cover it in depth here. Suffice to say, if you want to do something like close a Window with a keyboard shortcut (roughly emulating cmd+q on a Mac):

#q:: WinGetTitle, Title, A 
PostMessage, 0x112, 0xF060,,, %Title%
return

Remapping a key is similarly easy. As a VIM user, I like to map Caps Lock to Esc, we’ll do that here:

SendMode Input               ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
Capslock::Esc

AutoHotkey also forms the foundation for a tool we’ll discuss later in this guide: bug.n.

Wox

The next step of our mouse-free experience is a good application launcher. With an application launcher, we simply type the name of the program we want to open, instead of clicking on the taskbar or a desktop icon. Wox is my tool of choice, here; it’s designed to be reminecient of MacOS’s Spotlight tool. My usage of Wox is similar to that of the Windows start-menu search function, but with a few important differences.

Wox uses Everything by voidtools search as a back-end. Everything is header-only, more configurable and faster than the built-in-search. Everything’s behavior is also highly consistent. You won’t, for example, be left scratching your head and wondering why certain applications or files refuse to show up in your search.

Application launchers like Wox are also a great way to control system functions. Take, for example, putting the computer to sleep. Instead of wheeling the mouse down to the bottom left of the screen and clicking around several times, you can simply type a few letters and hit enter. Much faster!

I find the default Wox theme a bit ugly. Fortunately, custom themes can be installe in the AppData\Local\Wox\{version}\Themes directory. There are also several helpful plugins available on the project’s website.

Microsoft has actually just released their own application launcher. For the time being, I did not find PowerToys run a suitable alternative to Wox. There’s no option for system commands, and the launcher only finds programs.

Hunt-n-Peck

Based on Vimium, Hunt-n-Peck is a clever application for navigating through GUI windows using hinting. Essentially, the user activates hint mode by pressing a keyboard combo ( alt + ; by default). UI elements are then tagged, and can be selected by typing their hint.

This tool is most useful for quick ui operations; navigating to single elements, pressing buttons, etc. In cases where more involved interaction is needed, picking up the mouse makes sense.

QuickLook File Preview

Although not an essential tool for avoiding keyboard use, QuickLook is a lovely tool for those of us who also use Macs. In MacOS’s finder, we can select an item and press the space bar to preview it. This is very useful when working with media files, or more generally when inspecting files outside of a terminal environment.

Bug.n

Windows has some rudimentary tiling behavior built in. Using the Windows Key + Arrow Keys, you can snap windows to quadrants or halves of the screen. Tiling window managers—such as bug.n—take this idea to a whole new level. The arrangement of Windows on the screen is now automated. Manual control is provided only through keybindings. This sounds clunky, at first; but in the hands of an experienced user, the advantages are apparent.

video or gif

After downloading and extracting bug.n, we launch the program (via src\main.ahk). That’s right; bug.n is actually a wonderfully convoluted AuthoHotkey script. Once we’re done with setup, we’ll be left with a build something like:

Configuring bug.n

Before customizing our bug.n keyboard shortcuts, we have to create a configuration file. We can do this by pressing win+ctrl+s. The file is created at AppData\Roaming\bug.n. Optionally, we can quick open it with our default editor by pressing win+ctrl+e.

Bug.n’s settings are controlled from a config.ini file, found in AppData\Romaing\bug.n. I set my config.ini up as follows:

; bug.n - tiling window mfnagement
; @version 9.0.2

; # == windows key
; ^ == ctrl
; ! == alt

Config_readinCpu=0
Config_readinDate=1
Config_readinDiskLoad=0
Config_readinMemoryUsage=0
Config_readinNetworkLoad=0
Config_readinTime=1

Config_readinTimeFormat=hh:mm

; exclude wox launcher.
Config_rule=.*HwndWrapper.*;Wox;;0;0;0;0;0;0;
Config_rule=.*hap.exe.*;;;0;0;0;0;0;0;
Config_rule=Warhammer2;Total War: WARHAMMER 2;;0;0;0;0;0;0;

; win ctrl o : manually manage win10 metro apps.
Config_hotkey=#^o::Manager_override(1;0;0;0;1;0;)

;; Status Bar
;Config_showBar=1
Config_horizontalBarPos=center
Config_verticalBarPos=top
Config_barWidth=70%
;Config_singleRowBar=1
;Config_spaciousBar=1
Config_fontName=Roboto
Config_fontSize=10
;Config_largeFontSize=24

Config_backColor_#1=black;;;;;;;;; 
Config_backColor_#2=bd93f9;;;;;;;;;
Config_backColor_#3=bd93f9;;;;;;;;;
Config_foreColor_#1=282a36;282a36;282a36;282a36;282a36;282a36;ffb86c;ffb86c;ffb86c;
Config_foreColor_#2=bd93f9;bd93f9;bd93f9;;;;;;;
Config_foreColor_#3=bd93f9;bd93f9;bd93f9;;;;;;;
Config_fontColor_#1=f8f8f2;f8f8f2;f8f8f2;f8f8f2;f8f8f2;f8f8f2;f8f8f2;f8f8f2;f8f8f2;
Config_fontColor_#2=f8f8f2;f8f8f2;f8f8f2;f8f8f2;f8f8f2;f8f8f2;f8f8f2;f8f8f2;f8f8f2;
Config_fontColor_#3=f8f8f2;f8f8f2;f8f8f2;f8f8f2;f8f8f2;f8f8f2;f8f8f2;f8f8f2;f8f8f2;

;; Bar Elements
;Config_readinBat=1
Config_readinTime=12
Config_readinTimeFormat=hh:mm tt
; Config_readinVolume=1

;; Windows UI Elements
Config_bbCompatibility=0
Config_borderWidth=4
Config_borderPadding=2
Config_showTaskBar=1
Config_showBorder=1
Config_selBorderColor=blue

Let’s break down a few things in this file. By default, bug.n will try to tile any application that doesn’t fit its predefined exclusion criteria. This includes things like games, Wox, and even the hunt-n-peck overlay. Fortunately, defining rules for these cases is relatively straightforward.

Config_rule=.*HwndWrapper.*;Wox;;0;0;0;0;0;0;
Config_rule=.*hap.exe.*;;;0;0;0;0;0;0;
Config_rule=Warhammer2;Total War: WARHAMMER 2;;0;0;0;0;0;0;

Here we exclude Wox, hunt-n-peck and Total War (because I live a monogamous gaming lifestyle, Total War is the only game I play). As we can see from the bug.n documentation, the command arguments here represent the following:

Config_rule=<class>;
            <title>;
            <function name>;
            <is managed>;
            <monitor>;
            <views / tags>;
            <is floating>;
            <is decorated>;
            <hide title>;
            <action on a single window>

Of particular interest: the is decorated field refers to application control bars. For some legacy applications, bug.n is able to hide the window controls, leaving us with a nice, clean look. In cases like mine, where I wanted to exclude the application from bug.n’s control, setting every field to 0 is appropriate.

Creating a definition would be tricky, since the pattern matching bug.n uses to identify a process isn’t obvious from looking at the task manager or get-process in powershell. Fortunately, bug.n provides an easy interface for identifying client applications:

Config_hotkey=#i::Manager_getWindowInfo()

With the default binding # (the windows key) + i, bug.n will open a dialog box with the process’s identifying information. We can then copy this information into our Config.ini file, and set the control flags as needed. Generally, we can override any default bug.n hotkey from within our Config.ini file. The default keybindings can be found in the bug.n documentation.

From our Config.ini file, we can also customize the properties of our bug.n command bar. The command bar is useful for displaying an overview of our workspaces (areas) and for displaying the currently active window. Here are some basic command bar customizations:

Config_readinCpu=0
Config_readinDate=1
Config_readinDiskLoad=0
;Config_readinMemoryUsage=0
;Config_readinNetworkLoad=0
Config_readinTime=1

Config_readinTimeFormat=hh:mm

;; Status Bar
;Config_showBar=1
Config_horizontalBarPos=center
Config_verticalBarPos=top
Config_barWidth=70%
;Config_singleRowBar=1
;Config_spaciousBar=1
Config_fontName=Roboto
Config_fontSize=10
;Config_largeFontSize=24

Config_backColor_#1=black;;;;;;;;; 
Config_backColor_#2=bd93f9;;;;;;;;;
Config_backColor_#3=bd93f9;;;;;;;;;

We note some values are commented out with a ;. Naturally, the default value will be used here. The lines starting with Config_backColor are used to define the colors of the taskbar.

Bug.n is an old project. When using it in Windows 10, we may notice some features do not function as expected. For example, bug.n does not use Windows 10’s virtual desktops feature under the hood, but rather force hides the windows from the exiting workspace. This means that when we switch workspaces, we’ll see an annoying ‘fade’ effect on all our outgoing windows. Fortunately, we can disable these transitions from within Windows, or even do so from a PowerShell script.

There’s one last tweak I’d make before using bug.n. Turns out, in recent editions of Windows 10, Microsoft Edge is always running in the background—regardless of whether or not it’s your primary browser. Bug.n picks up on this, and forces the process to the foreground. In practice, if you use bug.n without disabling Edge’s background privileges, you’ll constantly have an empty instance of that browser launching on top of whatever you’re doing. So make sure you do that before using the tiling WM.

Conclusion

Tweaking Windows to a point where I’m happy using it was a fair amount of work. Once it’s done, though, there doesn’t feel like a huge difference between this OS and any other. I do wish there is a more robust for tiling in Windows than bug.n. Indeed with Wayland coming to Windows in the not-too-distant future, running a full fledged tiling-wm may well be possible. Until then, I’m satisfied with this.


© Bryce Smith, 2021