Monthly Archives: August 2022

Tiny Icons on High DPI Systems

9
Filed under Uncategorized

I’ve been using a triple monitor setup with all three running at high DPI (4k) resolution for some time now, and I love it. I use 200% scaling, so text is reasonably sized, but at 4k resolution, it’s so much clearer and easier on the eyes.

For the most parts, apps “just work” at that scalemode. But every once in a while, I’ll run into one that doesn’t.

Take for example, ClipCache:

Notice how the toolbar icons are tiny! The app’s excellent and I use it all the time, but the developer, while still supporting it, isn’t all that responsive towards updates, unfortunately.

But, it turns out there are things to try that might just resolve these sorts of issues without resorting to code updates by the developers.

Find the EXE file for the app in question. In this case, it’s Clipc.exe.

Right click and choose Properties, then Compatibility:

Now click Change high DPI settings.

You may have to experiment with the settings here. In the case of ClipCache, I set the Program DPI to checked.

Then checked Override high DPI scaling behavior.

And finally, selected System (Enhanced).

I suspect other apps may require slightly different options.

In any case, restart ClipC and presto!

No more tiny toolbar!

Application Access – Part I

7
Filed under Uncategorized
Plastic Black Container With Many Tools Elevated View Of Plastic Black Container With Many Tools On Wooden Table toolbox stock pictures, royalty-free photos & images

I’ve been doing a lot of reflecting lately on how my typical workday progresses and one of my primary realizations is that I spend a lot of time switching between applications.

There’s all the typical development applications, Visual Studio, VSCode, Command line, GIT, Insomnia, Web browsers, file search, clipboard stuff, etc. There’s usually an instance or two of these running, and I often find myself ALT-TABing between them.

Then there’s various utilities that I use regularly but not necessarily constantly: putty, SSH, Fusion, Dbgview, etc. Find it, Open it, Use it, Close it, repeat.

And finally there’s all the other apps that hang out in the periphery: Word, Excel, Outlook, Zoom, Remote Desktop, VMs and so on.

Now, I’ve pinned a few of those to the taskbar, so they’re just a mouse click away. However, there’s only so much space down there. Sure, I could stack some in a folder, which would present as a menu, but then often used items would inevitably end up hidden behind one or more layers of menus.

Of course, there’s the Start menu. But after awhile, that becomes large enough to prevent any kind of speedy access. And then there’s the Start Panel, but again, it can begin to get unwieldy fairly quickly for me.

Plus, when customizing the Start menu, etc, there’s the issue of synchronizing changes between machines. Google Drive helps, but not really for the Start Menu or TaskBar.

As I hinted at above, part of my realization was that there’s three levels of application usage for me.

Utility Belt Apps

These are apps that I almost always have running. I need to switch between them quickly and seamlessly. Adam Savage, of Mythbusters and Tested fame, even has a term for it, which I completely forget and can’t seem to locate right now. Irony?

In any case, the idea is that you shouldn’t have to move any tool to get to any other tool. And I can’t think of a better way to describe Toolbelt level applications.

And for that kind of accessibility, you’re really talking about one thing; hotkeys.

Windows does have the ability to assign hotkeys to shortcuts, icons, etc. but the selection is pretty limited, and when you regularly work with applications like VSCode or Visual Studio, most of the typical hotkeys are already in use by those apps.

Further, if I have two or more instances of any particular Toolbelt app open, I need to quickly switch between those instances, not go Alt-Tabbing through every opened desktop window.

Toolbox Apps

These are those apps I use often but that don’t really deserve being added to my Path. For these, finding them is usually the most time-consuming part. They aren’t constantly in use, but none-the-less, I’d like them to be ready at hand. For instance, when you need to hunt down a library binding issue with a .Net application, I’m gonna reach for FusLogVw, but that app isn’t normally on the path, or easily locatable.

Junk Drawer Apps

Everything else, which I’m perfectly comfortable leaving in the Start Menu where they’re installed and digging them on when I need them. They’re not used enough to justify going on the Toolbelt or in the ToolBox.

How you break things down? Have I missed anything?

I’ll be posting more as I start to solve this problem.

Making CapsLock Relevant Again

14
Filed under Uncategorized

I’ve seen a few articles here and there about Capslock, but now I’d like to throw my own spin on the topic.

Capslock is probably the most useless key on modern keyboards. It’s an antiquated holdover from the days when typing was actually a quite physical activity.

But now, about the only time Capslock gets hit is by accident. It’s BAD FORM TO SHOUT THESE DAYS, after all.

So… what can we do about that?

Ctrl, Alt, Shift Oh My!

If you’re anything like me, you spend your days in a host of applications, all of which have various functions assigned to just about every conceivable combination of hotkey. There’s all the standards: Ctrl-V, Ctrl-C, Ctrl-X. There’s the Ctrl-Shift variants and the Ctrl-Alt variants. Then there’s the less common Alt-Shift variants.

And then there’s those sadistic Ctrl-Alt-Shift hotkeys that exist just to make sure if you didn’t already have carpal tunnel, you will soon enough.

But what if you could use that CapsLock key as another modifier key; a Ctrl2 if you will?

Suddenly, you have a whole smorgasbord of easy to type hotkeys available. Not to mention Shift-Ctrl2 and Alt-Ctrl2 options as well.

And sure, Ctrl2-Shift-Alt, Ctrl-Ctrl2, and, well you get the picture.

Macro Apps

Sure there are macro applications and hotkey applications out there. Plus, your favorite applications may already have customizable hotkeys built in.

But, they likely only support some combination of Ctrl, Shift and Alt for hotkeys, which doesn’t much help with repurposing that CapsLock key.

Remapping

The first step toward solving this problem is changing the CapsLock key to something , almost anything, else.

It turns out, that’s far easier than you might think. On Windows, you can actually remap virtually any key to any other key with nothing more than a registry entry and a reboot.

“Ugh!” you say. “Editing the registry!”. I get it.

Head on over to https://github.com/randyrants/sharpkeys, and install it right quick.

It’s a tiny little app that takes the guesswork and tedium out of editing the registry for this purpose.

Here’s the entry I used. This will make the CapsLock key act like an F19 key (yes, there’s actually far more function keys than just the F1-10, but most keyboards don’t have them).

Why F19? Meh. Seemed like a far enough out-of-the-way F key to not likely get mixed up with any application’s intentional use of a function key. Plus, it works easily with the technique I’ll go into below. But choose whatever you like. There’s F1-24, plus quite a few Unknown key codes as well that would probably work too.

Click the Write to Registry button and close, then reboot. And done.

When your PC comes back up, give it a try, press Capslock.

Nothing. Beautifully, blissfully, nothing! No capslock light coming on. No SHOUTING. Nothing.

But What IF I WANT TO SHOUT!

At this point, you’re probably asking yourself, “But what about Capslock?”

Grab a copy of AutoHotKey and create this script:

*F19::
    If (A_ThisHotkey == A_PriorHotkey && A_TimeSincePriorHotkey < 300)
    {
        If GetKeyState("CapsLock", "T") 
            SetCapsLockState, off
        else
            SetCapsLockState, on
    }
    return

Save it to a file called CapsLock.ahk. And then run it with AutoHotKey.

Now then, just double tap the CapsLock key, and, presto, that CapsLock light will beam its soothing green rays right into your eyes once more.

Double tap again to turn it off.

Hot Keys! Hot Keys! Hot Keys!

Ok, so getting the ability to shout again is nice and all, but there’s gotta be more than that.

And, Oh, there is!

That AutoHotKey app you’ve already installed? You’ve only just scratched the surface of what it can do.

How about making CapsLock work like the Ctrl key? Create another AHK script like this:

F19::LCtrl

Or how about CapsLock-N starting Notepad instantly?

F19 & n::Run Notepad

Or how about CapsLock-Insert appending selected text to what’s already on the clipboard

F19 & Insert::
   clip := Clipboard
   SendInput, ^C
   ClipWait
   clip := clip . Clipboard
   clipboard := clip 
   return

The sky’s the limit. Get familiar with AutoHotkey and you’re likely to find a ton of uses for it.

And with CapsLock now available as a completely new (and completely open) modifier key, you won’t have to worry about conflicting with the hotkey definitions of any other application.

Remote Desktop

I spend almost all day connected to remote machines via remote desktop. A wonderful follow-on benefit of this technique is that, since you’ve remapped Capslock on the host machine, even when you’re connected to a remote machine, Capslock will still map to F19, so the remote machine won’t see any CapsLock keypresses either.

It will, however see F19 keypresses. So, you have the option of deploying and running your AutoHotkey scripts on the remote machine, and they will see the F19 keypress exactly like scripts on the host machine, to be used in any way you see fit.

Lastly

If you’re still following along and all this sounds great, keep in mind that the ScrollLock and those number pad keys can all be remapped in the same fashion. Depending on your typically workflow, that may or may not make sense for you, but the process is exactly the same.

Macros in VS 2022?

3
Filed under Uncategorized

I’ve lamented Visual Studio’s lack of built-in macro support for ages. I tried a few extensions a while back but they never quite measured up.
But I just stumbled across Text Macros for VS 2019-2022.

It’s perfect for a quick, one-off Record/playback macro, you can save macros, edit them (although that’s not ideal as the macros are saved in a rather obtuse XML format), and even assign them permanently to hotkeys.

It’s only good for text editing macros, so you can’t use it to “automate” Visual Studio itself, but I’ve yet to have a need to do that.

Fixing VSCode’s broken Ctrl-Right

1
Filed under Uncategorized

I’ve been using VSCode for quite some time now. Generally speaking, I’ve been super happy with it. It’s ultra configurable, fairly light weight, very fast, and just generally a pleasure to work with.

Except….

They completely got handling of Ctrl-Right wrong. Try it in Word, try it in Notepad++, in Visual Studio, you name it, they all work a certain way.

But VSCode, not so much.

Now, it’d be easy enough to get used to it, if all my editors decided to change the default way they handle Ctrl-Right. But, yeah, no.

I’ve dealt with it for a while now but this weekend, I finally decided to have a look.

It took some Google-foo, but eventually I came across this post by Spongman that very accurately describes the problem.

I won’t repeat that here, but here’s the keybindings for VSCode that fix the problem.

    {
        "key": "ctrl+shift+right",
        "command": "-cursorWordEndRightSelect",
        "when": "textInputFocus"
    },
    {
        "key": "ctrl+right",
        "command": "-cursorWordEndRight",
        "when": "textInputFocus"
    },
    {
        "key": "ctrl+right",
        "command": "-cursorWordAccessibilityRight",
        "when": "accessibilityModeEnabled && textInputFocus"
    },
    {
        "key": "ctrl+shift+right",
        "command": "-cursorWordAccessibilityRightSelect",
        "when": "accessibilityModeEnabled && textInputFocus"
    },
    {
        "key": "ctrl+right",
        "command": "cursorWordStartRight"
    },
    {
        "key": "ctrl+shift+right",
        "command": "cursorWordStartRightSelect"
    }

It’s a bit tricky to get them installed in VSCode, what with the new Settings UI, but, once they’re there, Mwah! Perfection!