How to Survive Without a Numpad. Alt ♫ Code ☼ Emulation ♥ on Tenkeyless (TKL) and Laptop Keyboards With Autohotkey, the "Unix Way"

Posted in Tips and tricks on 14 April 2025

I have recently obtained an extremely hard to find retro keyboard I always wanted.

It's one of those models with tactile mechanical switches, but not the deafeningly loud buckling spring ones. It both looks majestic and can actually be used on a modern PC thanks to the USB 1.0 interface.

Take a look. It's glorious!

my-retro-mechanical-keyboard

Typing on it brings back memories of the old-school terminal computers, and the time when I typed my first words on a similar mechanical, solidly built keyboard. Which might explain why I have come to love expressing my thoughts through writing so much =)

Ahem, anyway… There is just one tiny little issue with this keyboard. Coming from the early 2000's it completely lacks n-key rollover. Which makes it entirely unsuitable for gaming or any other applications where you're expected to press and/or hold several non-modifier keys simultaneously.

Think "WASD" 1st person shooter controls. That's not possible on a "retro" keyboard.

Online keyboard N-key rollover test

BTW, you can test your keyboard's rollover capabilities here.

I don't game much on my main PC, instead usually going for either one of my consoles or a fairly powerful guest-room laptop, which are all connected to a projector. So it's not really an issue. But I would like to have an option to make use of my monstrous RTX 4080 not just for rendering, video editing/encoding and running CUDA-accelerated apps, but for gaming also.

Consequently, I decided to get one of those compact wireless/wired "gaming" mechanical keyboards that are all the rage right now.

My Little Keyboards, My Little Keyboards...

After an extensive research, initial confusion and even shock, I landed on these two cuties. They both look so retro and slick, that I had to get both. Don't you judge me.

tkl-keyboard

compact-keyboard

And if you look carefully enough, you might notice that they both lack a numpad!

Whaaaat?

Well, it makes sense: a smaller "secondary" keyboard should ideally take less space at the edge of the table. You don't need a numpad to play a game. Well, unless it's the original GTA 3 or Vice City, where you would use the numpad to control a heli or a plane. But in 95% of games out there I'd say numpad is completely optional. Hence the compact form-factor.

So. Job well done? One keyboard for work, and a choice between the two "sawed-offs" — to connect over Bluetooth whenever needed, for a game session.

Still, I wonder... Could these two be used for work as well?

I mean, they do have nice clicky/thocky mechanical switches, so typing on them is a different, welcome experience. They are also wireless, allowing for better flexibility and more freedom. That's why I would really like to use them for work-related stuff from time to time if it weren't for the missing numpads!

What’s the Deal With the Missing Numpads?

Cute Cherry Blossom Numpad

Keyboards without numpads are commonly called "tenkeyless" or TKL keyboards. And there are some very heated debates online whether it's OK to use such a keyboard as a daily driver. Debates that in many cases devolve into a "boomer-vs-zoomer mindset" sort of a mess. I never really cared much about this. Until now, I suppose.

And although before getting the TKL keyboards I was leaning more towards the "boomer" side of the debate, it's not so clear-cut any more... Especially as it made me think about laptop keyboards that lack numpads, and how I would struggle with those due to this very issue.

laptop-keyboard-without-numpad

Still, if I keep an open mind, I have to wonder...

Do I Actually Need a Numpad?

Do zoomers have a point? I mean — how often do I personally use a numpad?

Turns out, quite a bit:

  • Obviously it's very convenient in Calculators or Spreadsheet apps, where you can quickly type out an arithmetic expression with one hand without ever having to hit Shift for math ops like "*" or "+"
  • After years in Photoshop I naturally tend to reach for numpad "-" and "+" keys with hotkeys for zoom in and out (CTRL+"-", CTRL+"+") as well as other hotkey combos that use these keys
  • Sometimes I use the numpad Enter key even when not performing any calculations, since my right wrist often rests next to the numpad, closer to the mouse on the right
  • In important business documents I make use of a non-breaking space (Alt 0160) to keep names with initials as well as dates from breaking apart (i.e. "John S. Martin" or "May 1st, 2001"). See this Wikipedia article for more info
  • Even when typing in work chats I often prefer to omit emojis and go "old-school" with such cool ANSI/Unicode characters such as as ♥ (Alt 3) or ♫ (Alt 14). Or decide to nicely format a list in an app that doesn't support rich formatting with • (Alt 0149) and make good use of some other "special characters".

All in all, losing numpad would be quite inconvenient, since out of all of these cases, some actually require using the numpad: entering those Alt code characters is only possible with numpad number keys pressed in sequence when holding Alt. At least in Windows.

Why Did It Have to Be the Numpad?

ibm-pc

It's pretty simple actually: that's how character codes were done on the very first IBM PCs.

In the IBM PC BIOS, one could enter characters that weren’t present on the keyboard by holding the Alt key and typing the decimal value on the numeric keypad. When it comes to Windows, upon its release, Microsoft decided to use the same approach as the IBM PCs did. That's pretty much it. If you want the full story, you can find it on Wikipedia.

On a full-size keyboard Alt codes could also only be entered with Num Lock enabled. Otherwise you'd just send a bunch of random inputs, since without Num Lock, numpad keys act as all kinds of navigation keys.

But what about TKL keyboards?

Well, since there's still no official way to input such character codes without a numpad in Windows, we will simply have to come up with a solution of our own.

Standard Approach: Change Windows Registry

If you're looking for the most straightforward strategy to key remapping, your primary option is to make modifications to the Windows registry, and change how certain keys or key combos are processed by the OS itself. You can do this either manually, or with the help of specialized software, of which there are 3 that are well-known:

In spite of their "cosmetic" differences, these are identical in their function: they streamline and simplify working with the Windows registry when it comes to keyboard layout customization. Naturally, after modifying the registry, you'd need to reboot your OS for the changes to take effect.

microsoft-keyboard-layout-creator

Regardless of which one of these you go with, you'll end up changing how all keyboards in the system are processed. So there'd be no easy way to only apply this to certain boards, or easily enable/disable custom key remapping without once again modifying the registry and rebooting the OS. If this is something you'd be OK with — go for it.

There is, however, a different, "non-destructive" approach to solving this problem…

An Alternative Strategy: Small. Portable. Unix Way

How about instead of changing the registry in each OS we use, we develop a portable app that would act as an Alt code numpad emulator only while it's running in the background?

I am a big proponent of the "Unix way" philosophy to software development: instead of a giant multi-purpose piece of software with hundreds of functions, parameters, keys and switches, you instead develop and collect a set of smaller apps that do one thing, but do it well and with extreme reliability. Therefore over time I developed a bunch of small utilities (or tools) that either run in the background or are executed whenever needed to make my life easier. For instance:

  • "Adobe Mate" — a "helper" utility that is only active in Adobe Premiere/After Effects CS6 and allows me to zoom the timeline in Premiere by just scrolling the mouse wheel. It also automatically performs a second press of the Alt key to remove focus from the top menu in Premiere, an issue that is infamous for how infuriating it can be. The utility also allows to use the middle mouse button to drag the timeline, something that normally requires you to: 1. switch to the "Hand" tool using the "H" key, 2. use it, 3. finally, switch back to whichever tool you were using prior to that manually. Every time. Well, the utility does that automatically as soon as I press, hold and then release the middle mouse button
  • "On Top Window Toggler" — a trivial utility that allows to show any window on top of other apps by pressing Alt+Control+Space, or revert to the normal behavior with the same combo. It's a surprisingly simple, yet effective way to add "Display on top" functionality to any application I use
  • "Local Notification" — a multiple-instance tray app that creates Windows Notifications with Titles and Descriptions provided as command-line parameters. I use it as a callback from certain software to see when a scheduled task has started. Each notification lives for a minute and gets logged on the Windows Notification panel, so I can always find out the details even if I missed the pop-up notification itself

utilities-in-system-tray

The aforementioned programs were developed using Autohotkey V1 and then compiled into applications with the help of the bundled AHK2EXE complier. After which they were moved into the "My Utils" folder. Kind of like many of those Linux tools that are bundled with any Linux distro and reside in the /bin directory. Indeed, if you didn't know, all those command-line utilities you regularly use like: "ls, cd, rm, mkdir, cat, gzip, grep, wget, ssh" etc. — are all just small executable binaries and not some direct calls to the Linux kernel itself.

terminal-screenshot

Being super simple, each one of the utilities I built requires 1-2MB or RAM to run either as an Autohotkey script or as a compiled executable. So you could easily have tens or hundreds of them running in the background, each doing its own useful thing with a fraction of your total PC RAM. It's an efficient, portable and easy to maintain approach to developing software utilities.

That's why I decided to turn to Autohotkey once again to solve the issue of Alt code character input on keyboards without numpads. We'll develop a small program that would temporarily remap all Modifier(s)+number row key presses into virtual Alt+numpad key presses, granting TKL and laptop keyboards the "numpad superpowers".

Alt Code NumRow Emulator

I've identified two primary ways to remap all number row keys to numpad keys while some modifier key or keys are held:

  1. Capture the number row keys and instead send them as numpad keys as soon they are pressed
  2. "Accumulate" input while the modifier key(s) held, and then re-send the sequence as numpad keycodes upon release of the modifier key(s). This way if you hold your modifier, then input "0,1,5,1", following the release of the modifier this sequence will be re-sent as numpad keys with Alt also held, virtually. This would then successfully produce a long dash "—". Basically, this means replaying the code sequence as if it were entered via a numpad in the first place

Option 1: Caps Lock as a Modifier?

You might think that the former method is superior, since it immediately sends pressed keys as if they were numpad keys. And hence would allow to emulate numpad keys at will, and not just when you need to input special character combos. In several articles I've seen, they recommend using the Caps Lock key for a modifier.

browser-window

I had hopes for this method, since with it, I would be able to simply hold Alt+Caps Lock and input a code for a special character, and then release both to see that character inserted into a text field.

Alas, turns out this worked well only for one digit-long codes (like Alt+Caps Lock, 5 to get ♣) and would break in all sorts of ways when trying to input longer combos (like Alt+Caps Lock, 0169 for ©). For example, upon releasing Alt and Caps Lock after typing a code sequence, depending on which one was released first (they are separate keys after all), the script in most cases wouldn't let go of the last "virtual key" or something, which would cause it to continue typing that one character until Alt or Caps Lock were pressed again, to break the cycle. Very confusing and hard to diagnose. Even with a different key for a modifier this issue would persist.

Please, don't trust my results and do your own tests. Maybe it will work well for you after all. In my case, on 3 different systems I would get the same problems trying to reliably input codes with 2 or more digits in an Alt code sequence with this method.

To make things worse, Caps Lock is a toggle-type modifier key. It's ill-suited for use cases where you want to utilize it as a hold-type modifier. Simply because it will always try to toggle its state on and off upon each press.

caps-lock-blinking

Therefore, this method is unsuitable for cases where you're controlling another PC via remote desktop software like RDS, VNC, TeamViewer and the like. This is because the "SetCapsLockState, AlwaysOff" command that keeps Caps Lock mode always off is only maintained of the remote PC you're controlling (the one that would have the script active). So, if you press Caps Lock in your "host" system, it will actually activate the Caps Lock mode and send keys into the RDP/VNC/TeamViewer window as if they were pressed with the Shift key held, to achieve capitalization. Which would drive you mad. So you would either need to have the tool running on both machines to force Caps Lock into an off state, or have to forego using remote control software altogether.

Option 2: Alt Key Sequence Input Accumulator

Considering that Alt-number combos can consist of several numbers, we'll capture a sequence of all number row keys pressed while Alt was held, and then "replay" it in the background, but with numpad keycodes held together with Alt, instead.

Not much else to explain, so here's the code I ended up with after several iterations:

; -----------------------------------------------------------
; ALt Code NumRow Emulator (with Global Exclusion Patterns)
; Portable Alt Code Input for Keyboards Without a Numpad V1.4
; -----------------------------------------------------------

#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
#Persistent
#SingleInstance force

; Program/Process names to exclude (wildcards allowed at the end)
global excludePatterns := ["xsi.exe", "mpc*", "Photoshop*", "AfterFX.exe", "calc*"]
global altBuffer := "" ; Global buffer for storing digit characters

; Tray tip and menu
Menu, Tray, Tip, Alt Code NumRow Emulator
Menu, Tray, DeleteAll
Menu, Tray, Add, About..., AboutHandler
Menu, Tray, Add, Exit, ExitHandler
Menu, Tray, NoStandard
Menu, Tray, Default, About...
Menu, Tray, Click, 2
Return

AboutHandler:
MsgBox 64, About, Alt Code NumRow Emulator `n` `n`This script allows you to type Alt codes (like Alt-3 for a heart character) using the regular number row on keyboards without a numpad. When you press and hold Alt followed by a digit sequence, each digit is appended to a buffer. Upon releasing Alt (left or right), the script emulates holding Alt and sends the entered sequence as *numpad* keystrokes to execute the code. When the active window is one of the excluded apps (e.g., matching mpc*, or Photoshop.exe), the script is entirely disabled so that native Alt+digit hotkeys work as usual.
Return

ExitHandler:
ExitApp

; Processing possible when NonExcludedProcess() returns true
#If NonExcludedProcess()
!0::  altBuffer .= "0"
!1::  altBuffer .= "1"
!2::  altBuffer .= "2"
!3::  altBuffer .= "3"
!4::  altBuffer .= "4"
!5::  altBuffer .= "5"
!6::  altBuffer .= "6"
!7::  altBuffer .= "7"
!8::  altBuffer .= "8"
!9::  altBuffer .= "9"
; When either Left Alt or Right Alt is released, process the buffered digits.
~LAlt Up::ProcessaltBuffer()
~RAlt Up::ProcessaltBuffer()
#If ; End hotkey processing

; Returns true if the current active window process is not excluded
NonExcludedProcess() {
    global excludePatterns ; Reference the global array.
    WinGet, procName, ProcessName, A
    StringLower, procNameLower, procName ; Case-insensitive matching
    for index, pattern in excludePatterns {
        ; Convert wildcard pattern (e.g., "mpc*") to regex ("^mpc.*$")
        regexPattern := "^" . RegExReplace(pattern, "\*", ".*") . "$"
        if RegExMatch(procNameLower, regexPattern)
            return false
    }
    return true
}

; Sends valid sequence of digits as Numpad keystrokes with Alt
ProcessaltBuffer() {
    global altBuffer
    if (altBuffer != "") {
        Sleep, 50 ; A brief pause to help ensure the system is ready
        Send, {Alt down}
        Loop, Parse, altBuffer
            Send, {Numpad%A_LoopField%}
        Send, {Alt up}
        altBuffer := ""
    }
}

How To Use:

  1. Save this code as an .AHK file. For example: "Alt Code NumRow Emulator.ahk"
  2. Download the latest Autohotkey V1 bundle, and install it. Note that to run this particular script, you need the v1.1 version of Autohotkey, not v2
  3. Double click the .AHK file you have created to execute it. You will see the green "H" icon in your system tray, indicating that the script is running
  4. Press and hold either of the Alt keys and input a code (i.e. Alt, 3 for a heart ♥), release the Alt key
  5. To access the Windows Startup folder, press Win+R and type shell:startup. Then, either copy your .AHK file to this folder or create a shortcut to have the utility start automatically when your system boots up
  6. If you want to share your script with others or use it on a machine without Autohotkey installed, you can compile your script file into an executable using the bundled AHK2EXE compiler, located in AutoHotKey/Compiler. This will produce a self-sufficient, portable little utility program

Short FAQ:

  • Note how at the beginning of the script you can specify a list of processes which should be ignored by the script. This will help to avoid conflicts with existing Alt+number row key shortcuts. You can specify exact process names or place a wildcard at the end to match any variations that might have slightly different process names. The ones I've already specified are those which I use, and which wouldn't benefit from the ability to input special characters anyway. For instance, "mpc*" stands for all Media Player Classic processes. The reason being — Alt+1/2/3/4 hotkeys in MPC are used to change the zoom of the video being played. Process exclusion is a common practice when writing and using Autohotkey scripts. That's why you can find a "WindowSpy" utility in the root folder of your Autohotkey installation: it will help you find out all information you'd ever need to identify any program window
  • As for why not use the latest version of Autohotkey — it's complicated... Simply speaking, V1 has been out for many years and, as a result, has an extensive amount of scripts available on the web. V2 is a true successor that is indeed superior to the previous branch in many ways. However, it also completely changes the syntax and the flow of the previous Autohotkey scripting language, requiring all V1 scripts to be manually rewritten to be compatible with V2. Therefore, I personally prefer to use V1, as I have accumulated a large collection of scripts and tools that I use occasionally

Congrats! Your tenkeyless keyboard can now be used to input Alt codes with ease.

♫ Celebrate ♪ with a cup of ☼ hot tea ☺

cup-of-alt-code-tea

Gets The Job Done*

After using this script for a while, you'll probably find out that it's not flawless. This is expected, as we were never"officially" meant to input Alt codes this way in any version of the Windows OS or third-party software.

As a result, in some apps holding and releasing the left Alt key can activate the window menu bar, or change focus to the hamburger menu button. Both of which result in no special character being inserted into the document or work area itself.

Luckily, there are ways deal with this:

  • A workaround I use: simply press a shift key once right after the combo, but before releasing Alt. This will prevent the menu from stealing focus. In my experience, this will allow to successfully insert a special character into a document in most apps that would otherwise steal focus, like Chrome or Chromium, OnlyOffice and others. Example:
    1. Hold Alt
    2. Input 0,1,7,4
    3. Press Shift (quick press, no need to hold)
    4. Release Alt
    5. Tada! Have a ® character inserted into the text field
  • Another option is to go with the right Alt instead. This might sidestep the menu call in a particular app that's causing you trouble
  • You may try and utilize another hotkey to activate the capture, rather than Alt. Which one though — is up to you

Windows Secure Desktop Side-Note

An important note on using special characters in your passwords.

if you have software that utilizes the Windows Secure Desktop feature for password entry, this method will fail to help you insert special characters into the password field.

Secure Desktop is specifically designed to protect from malware and input-monitoring software like viruses and keyloggers by switching the user into an empty, separate desktop environment to input the password there. Hence, our little utility app would be rendered useless in the Secure Desktop environment.

In this situation your only way out is to either:

  • Try and make use of Windows virtual keyboard to enter the Alt code sequence
  • Or, if you're using a laptop, — refer to the manual to find out if the manufacturer of your device implemented a way to input numpad keys with some sort of an Fn-key combo
  • Finally, you can always connect a full-size keyboard to the machine and use its numpad directly, or even purchase a dedicated numeric keypad. Like this one. Isn't it cute?

numpad-keyboard

Can Be Improved Further

Naturally, the resulting utility can be customized to fit your particular needs.

For instance, you may decide to:

  • Set up a hotkey to disable/enable Alt code capture and emulation when needed
  • Add another key to hold together with Alt — say, the "Windows key" — to further minimize the chances of hotkey conflicts. Make sure to do your homework and confirm that the combination you choose to go with won't cause even more potential conflicts. For instance, this would conflict with the default Windows combo of Win+1/2/3 etc. that's used to switch between tasks on the taskbar
  • You might even implement a config.ini file reading and writing procedures, to store persistent settings between launches. For example, code in a full-fledged pop-up window with a text area, where ignored processes could be specified (or even selected like in the "process spy" bundled example) and saved into a file. And although with such changes the app would no longer be "simple", as a developer only you get to decide what level of complexity is acceptable for your particular use case
  • Rewrite the code to make it compatible with the Autohotkey V2 branch, if you wish

There's a lot of room for experimentation and discovery with this approach. I would genuinely love to hear about your experience with this issue, and whether you were able to come up with a better portable solution than mine.

Other Ways to Insert Special Characters and Emojis

Just for the full picture, I'll also mention that you don't necessarily need to bother yourself with Alt codes. There are at least two more methods that can be used on almost any device to input special characters or even Unicode emojis.

🎉Windows Emoji Panel 🎈

Did you know that in Windows 10 and 11 you can use Win+. or Win+; hotkeys to access the Emoji Panel? As it shows up, try typing a descriptor of what it is you're looking for, like "fireworks". If needed — switch modes between emojis, kaomojis and special symbols, although the latter two don't support descriptive search and instead just list all available characters.

windows-emoji-panel

📝 Emoji Autocomplete 📜

You're also probably aware that in many modern apps, regardless of the OS you use, you can type a semicolon ":" followed by a descriptor and get a list of emojis to pick from. Try it in Telegram, Slack, Google Docs and any other apps you regularly use.

semicolon-emoji-picking

Curious About Autohotkey Scripting?

I bet after finding out about Autohotkey and how it can be used to create useful scripts, and even produce actual portable applications (even ones with a graphical user interface), you're probably curious what other tasks Autohotkey can be good for.

Wonder no more! Check out official Autohotkey docs and forums to learn more about the available functions and existing code snippets, to prototype and develop a useful utility or two for yourself.

Looking For More Small Utilities?

Admittedly, I don't always create small portable software utilities by myself. There are some I use which are either developed by Microsoft (Process Explorer, Autoruns) or by third-party devs. For instance, check out NirSoft — there you'll find a huge list of freeware tools and utilities for all sorts of tasks.

Here are some of the utilities I use from time to time:

  • LiveTcpUdpWatch
  • CurrPorts
  • WakeMeOnLan
  • FileTypesMan
  • DiskSmartView
  • BatteryInfoView

filetypesman-screenshot

I'm positive you will discover something that will fit one or more of your needs.

And in the meantime…

Have fun with your Custom Modded Hotswap Wireless RGB Gaming PBT-Keycap Thocky Lubed Switch TKL keyboard, you zoomer! ♥ ☼ ♪

filetypesman-screenshot