Making CapsLock Relevant Again

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.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*