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:


Use Karabiner to program the keys.

See Mac: Keyboard/Automation Tools


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, use xvkbd. See Linux: xvkbd tutorial


Emacs: Bind Number Pad Keys

Programable Keypads

  1. Programable Keypads
  2. Best Numeric Keypads
  3. How to Program Number Keypad as Function Keys
Did i $save$ you from getting a brick?

$5 me, at patreon
or paypal to

If you have a question, put $5 at patreon and message me.