Archive for the ‘Windows’ Category

Use Synaptics touchpad while typing (Windows)

Sunday, April 24th, 2022

Windows laptops are consistently a worse experience than MacBooks, a large part of which has to do with the behavior of the touchpad. After installing Windows 11 on a ThinkPad X1 Carbon (3rd gen), I was recently dumbfounded by the inconsistency of the built-in trackpad and mouse buttons. Specifically, left clicks seemed to be dropped at random, which is infuriating. After a couple of weeks, I realized that it isn’t actually inconsistent: left clicks are consistently disabled for a second or so after typing on the built-in keyboard. The same thing goes for the touchpad.

Worse than a terrible default setting is a default setting that the user cannot override. The Synaptics settings window has a lot of options, but none that fix this atrocious behavior, which makes it almost impossible to use programs that require frequent switching between the keyboard and the mouse (which is, like, almost all graphical applications).

Fortunately, there are apparently (1, 2) some registry keys that control this behavior! Specifically, these two:

  • HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\PrecisionTouchPad\AAPThreshold
  • HKEY_LOCAL_MACHINE\SOFTWARE\Synaptics\SynTP\Defaults\PalmKms0, PalmKms1, …

(more…)

Scale: Scroll on desktop to zoom windows

Thursday, December 30th, 2021

As the name of this blog implies, I’m a fan of the desktop metaphor. I find the virtual desktop a great place to put everything that you know you’re going to be accessing frequently.

The only problem with the desktop is that it is often obscured by windows. While OS X offers a well-designed workaround, accessible via a multi-touch gesture, Windows has no great solution by default. You can press Win-D to show the desktop, but if you double-click a desktop icon, you’re going to lose your original window arrangement. The alternative is to use Win-M to minimize all windows and then Win-Shift-M to restore them, but that’s two separate key bindings that you need to keep track of – plus they’re fairly difficult to type.

Scale is my own solution. It is an AutoHotkey script that “zooms” (i.e. resizes) all windows whenever the mouse wheel is turned while the cursor is hovering over the desktop.

Demonstration of zooming windows in and out.

As you can see in the animation, I can easily reveal hidden desktop icons by scrolling the mouse over the desktop. To quickly restore the original window sizes, I can middle-click the desktop.

Permission to use, copy, modify and/or distribute this software for any purpose with or without fee is hereby granted.

Attachments

Move Thunderbird’s remote content warning to the bottom

Sunday, April 18th, 2021

I have sort of a love-hate relationship with Thunderbird (and with Mozilla in general). Each version seems slower and less pleasant than the previous, but it is still hands down the most capable cross-platform e-mail/news client there is. I use it not only to read my e-mail, but to view and keep track of various newsgroups too.

While it could sure start a bit quicker, all in all, I’m fairly happy with it. But there’s one piece of poor user interface design in that has been bothering me lately: the remote content warning.

Remote content warning

“To protect your integrity, Thunderbird has blocked the remote content in this message.”

I appreciate the heads-up, as well as the fact that I’m offered a convenient way to modify my image blocking settings. The problem is that this yellow bar appears with a slight delay. Whenever I open an HTML message with remote images, the body of the message appears, but is immediately relocated to make room for the yellow bar, which pushes it down with an animation. Needless to say, this is incredibly annoying.

The saving grace of Mozilla’s programs is that they’re fairly easily customized. If you add the following code to a file named userChrome.css located within the chrome directory of your user profile directory (just create it if it doesn’t exist), then the yellow bar is shown below the message body instead:

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");

#msgNotificationBar {
    -moz-box-ordinal-group: 2;
    margin-bottom: -1px;
    border-top: 1px solid rgb(145, 145, 145);
}

Remote content warning at bottom

Now, I’ve tested this in Thunderbird 38, and I’m not sure whether it works in recent versions of Thunderbird. The development of GUI programs tends to get worse with age, and I wouldn’t be surprised if the ability to do this has been removed. Regardless, it works in the version of Thunderbird that I’ve personally settled on. I was able to figure it out thanks to the add-on DOM Inspector Plus.

Edit Windows file types with FileTypesMan

Wednesday, April 7th, 2021

To keep track of which programs should open which files, Windows uses a system with three basic units: file extensions, file types and actions. File extensions like .html and .txt are associated with a single file type, which is called things like ChromeHTML and txtfile. The file type includes a number of actions, such as Open and Edit, each containing a command string, which tells Windows how to open the file.

Back in Windows XP, the Explorer included a very useful dialog window in which you could manually edit the association between file extensions and file types, as well as the actions belonging to each file type. I personally used this extensively. Specifically, I like to customize the Edit menu item for various file types. For example, I could click Open on an HTML file to open it in my web browser and click Edit to open it in my HTML editor.

Unfortunately, this feature was removed from later versions of the Explorer. Many third-party alternatives have been developed, but the most powerful and reliable one that I’ve found is FileTypesMan by NirSoft. While initially a bit confusing, it is a very capable program, and I thought I’d share some tips about it in this post.

Installation

FileTypesMan doesn’t include an installer, but I prefer to extract the archive into %ProgramFiles%\NirSoft. Then, I run the following command in a command prompt with administrative rights:

mklink /j "%AppData%\Microsoft\Windows\Start Menu\Programs\Nirsoft" "%ProgramFiles%\NirSoft"

This creates a directory junction between the NirSoft folder and a new NirSoft folder in the current user’s Programs folder. This makes FileTypesMan easily accessible from the Start menu. Furthermore, the contents of the NirSoft folder will be included when I make a search from the Start menu.

Interface

FileTypesMan’s interface is divided into two sections: at the top, the list of all registered file types, and at the bottom, the list of all actions of the currently selected file type.

Main FileTypesMan window

You can search by file extension by typing anything while having the file type list selected. To search by other fields, use Edit Find (Ctrl-F). In the screenshot above, I’ve selected the .html file extension by typing .html (including the period). As you can see, it is associated with the ChromeHTML file type, which contains three actions: EditEdit2 and open.

Open and Edit are common actions, often defined by default, but I’ve added Edit2 myself. For ChromeHTML files, I’ve defined Edit to open KompoZer, my WYSIWYG editor, and Edit2 to open Notepad2, my plain-text editor.

Editing file types and actions

You can create a new action or edit an existing one by right-clicking in the action list. This brings up a menu where you define the internal action name, the menu caption (i.e. the text displayed in the Explorer’s right-click menu) and the command string describing how to open the file. Furthermore, you can copy and paste actions between multiple file types via the Copy Selected Actions option in the right-click menu.

Edit Action

The Edit Action window.

In the file type list, you can double-click a file extension/type in order to edit its properties. You can create a completely new file extension via Edit New File Extension (Ctrl-T).

Edit File Type

The Edit File Type window.

Creating new file types

The only thing that FileTypesMan can’t do is to create new file types per se.  It can create new file extensions, to which actions can be attached as well, but not new file types. Fortunately, it’s fairly simple to create a file type manually. Just edit and apply the following .reg file:

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\YourInternalName]
@="NAME TO BE SHOWN IN EXPLORER"
[HKEY_CLASSES_ROOT\YourInternalName\shell]
[HKEY_CLASSES_ROOT\YourInternalName\shell\open]
[HKEY_CLASSES_ROOT\YourInternalName\shell\open\command]
@="PROGRAM WITH WHICH TO OPEN FILE \"%1\""

Then, you can associate your file extension with your new file type by right-clicking on it in FileTypesMan and selecting Replace File Type For Selected Extension.