Free AutoHotkey Virtual Numeric KeyPad App

A Quick Little AutoHotkey Script for Small Laptops with No KeyPad

Ever want a pop-up numeric keypad on your Windows computer screen? Use this one.

If you own a Windows laptop computer without a number keypad or want to use the click of a mouse rather than your fingers to punch numbers, then you’re going to like this one. A person with the forum name sveco produced a short AutoHotkey script which places the number keypad on a Windows computer screen (see Figure below left). The beauty of this app is that it never takes the focus away from your working document. When you click on the keypad, it does not become active and will send the input to your last active window.

KeyPadYou can use it with any Windows program to input numbers or use the cursor keys. For the right person, this could be just the ticket. The only issue was that the keypad on a keyboard (if you have one) doesn’t necessarily sync with the pop-up, but if you don’t have a keyboard numeric keypad, it’s no problem.

You don’t need to know AutoHotkey to use this app. I’ve compiled it and posted both the KeyPad.ahk and the KeyPad.exe files in a ZIP file at the ComputorEdge AutoHotkey download site. Download the compressed ZIP file, and extract the EXE file. Double-click and the app loads. Click the little x in the upper right-hand corner to close the app.

AutoHotkey Notes for KeyPad

For people who are learning AutoHotkey (and you should be learning if you don’t already use AutoHotkey), there are a couple of features of note in this short script. The fact that the keypad is never active, yet is clickable has implications for other AutoHotkey scripts acting as control panels. The controls can innocuously sit on the screen until they are needed, yet, even then, they won’t interfere with the active window. Let’s look at how it’s done.

The first line of code needed to produce this effect is:

Gui, +LastFound +AlwaysOnTop +ToolWindow +Border +E0x08000000

With the exception of +AlwaysOnTop and +E0x08000000 most of these parameters are cosmetic and can be found in the GUI Options section of the online documentation. Naturally, the keypad must be always-on-top since it would be ridiculous for it to disappear behind other windows every time another window is clicked.

The second option +E0x08000000 is a little more cryptic. This parameter is part of the Extended Window Styles (WS_EX_NOACTIVATE 0x08000000L) built into Windows. It is called as an option in AutoHotkey GUIs by placing +E in front of the number. The +E0x08000000 option calls WS_EX_NOACTIVATE which prevents the window from activating when the user clicks on it. Yet, the window still intercepts the click.

The next line of interest is:

Gui, Show, x1350 y87 h260 w215 NoActivate

The NoActivate option prevents the window from becoming the active window when initially displayed. Between the two parameters (+E0x08000000 in the Gui command line and NoActivate in the Gui, Show command line), the window is now clickable, always available and never active.

This little script could easily be made into a hotkey by adding the Gui, Show line of code to a hotkey combination somewhere after the auto-execute section of the script:

^!k::Gui, Show, x1350 y87 h260 w215 NoActivate

But you will want to remove the GuiClose: subroutine, otherwise the script will exit (ExitApp) anytime you close the window and the hotkey combination will be useless. (I added CTRL+ALT+K as a line in the AHK file, but the semicolon, which turns the line into a comment, must be removed. Don’t forget to comment out the GuiClose label with a semicolon in front of each line.)

If you want a transparent keypad, then there are two lines in the code which merely need to be uncommented (remove the ; before each line).

This KeyPad app is yet another cool way to use AutoHotkey.

One thought on “Free AutoHotkey Virtual Numeric KeyPad App

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s