How to Program Number Keypad as Function Keys

By Xah Lee. Date: . Last updated: .

This page shows you how to set the number-pad keys as function keys, for {Windows, Linux, Mac}. For example, set a key to copy, paste, switch to browser, close tab, etc.

keyboard number pad 1564
keyboard number pad

Microsoft Windows

First, you need to install AutoHotkey.

[see AutoHotkey Tutorial]

Create a file with the following content.

; set number pad keys

NumpadDiv::Send ^{PgUp} ; previous tab
NumpadMult::Send ^{PgDn} ; next tab
NumpadSub::Send ^w ; close window

Name the file “numpad_keys.ahk”.

Now, double click the file to run it. It will run in the background, and now you can press the / * to switch to pre/next tab, and - to close tab.

For more examples, see:


For Linux, there are 2 things you need to do.

  1. Set a key to run a shell command.
  2. The shell command does action. It can send key combination such as 【Ctrl+c】, or {switch, close, launch, …} {windows, apps, tabs, …}.

For Linux desktops such as Gnome, KDE, Ubuntu Unity, Xfce, there's a GUI that lets you easily set a key to run a shell command. Look for it in your system control panel.

xfce keyboard setting panel 2013-06-01
Xfce keyboard setting panel

I recommend using the desktop GUI to set a key. Otherwise, you can use xbindkeys. See Linux: xbindkeys Tutorial

For {switch, open, close} windows, see Linux: Add Keyboard Shortcut to Switch App

For sending key combinations such as 【Ctrl+c】, 【Ctrl+w】, 【Alt+Tab】, use xvkbd. See: Linux: Set F2 F3 F4 to Cut Copy Paste


For Mac, by default, it's impossible to make the number pad do anything other than inputting numbers, because Mac does remapping at some low level.

You need tool to set keys on number pad, see: Mac: Key Remapping, Keybinding Tools .


Emacs: Bind Number Pad Keys

Buy Numerical Keypad

If your keyboard doesn't have number pad, you can buy them, cheap.

Best Number Keypad

Programable Keypads

Alternatively, you can get keypad that are programable by itself.

Logitech G13 Gaming Keypad Review
Did it help?

Tip me, at patreon

Ask me question on patreon