How to map numlock to open calculator?


(D Bnonn Tennant) #1

I apologize if I’ve missed something obvious; I’ve searched for an answer to this question, but the only likely culprit looked like the code Consumer_AL_Calculator in the key_defs_consumerctl.h keymap ( I duly tried replacing LockLayer(NUMPAD) in the keymap with this code, but upon uploading to the keyboard, the numlock key now just does nothing (when I tried just remapping the open calculator command to whatever numlock now is, Ubuntu didn’t even register a keypress).

I don’t use keypad numbers, and never have, but I do find it very useful to have a shortcut key for opening my calculator. Can anyone help me with this minor but annoying problem?


If you are using Windows, you can use

Have your keyboard send a keycode (like F13 (yeah, it doesn’t end at F12)). That keycode is interpreted by AHK, which then starts your calculator.

AHK is extremely powerful, I use it for all kinds of commands and tasks and what not.

In your keymap, replace LockLayer(NUMPAD) with Key_F13 and put this in your AHK script:

F13::Run "calc.exe"


Some of the key definitions don’t do anything. Consumer_AL_Calculator might be one of them.

See Key_Cut/Copy/Paste and other keys in key_defs_keyboard.h

(D Bnonn Tennant) #4

Hrrm, I’m using Ubuntu, but at your suggestion I replaced numlock with F13. Ubuntu seems to interpret that as “Tools,” so I’ve remapped that to open calculator and it’s working perfectly. Thanks!

One odd thing for anyone else trying this in Ubuntu: for some reason I had to set the new key twice. The first time it said it had replaced the old shortcut, but hitting numlock didn’t actually do anything. So I went in again and this time it had a “Set” button instead of “Replace” for the keyboard shortcut, and setting it worked fine.