Windows 10 Is Getting More Customization Options
31 marzo, 2021
Microsoft Releases KB5000842 as an Optional Windows Update
1 abril, 2021

How to Remap a Broken Keyboard on Linux, macOS, and Windows

If your keyboard has a broken or missing key, working on it can be challenging. In general, regardless of whether you use a laptop or an external keyboard, it’s plausible that it could run into such keyboard problems over time.

While there are several ways to fix a broken keyboard, the simplest (and beginner-friendly) method is to blow away the dust or debris entrenched in the keyboard activity.

However, there are instances when this doesn’t work. An alternative solution at such times is to remap the broken key to another key on your keyboard.

What Is Key Remapping?

Remapping a key is a fail-safe solution to fixing a broken keyboard. It involves assigning the value of one key to another, thereby enabling the corresponding character to appear when pressing the other.

Now, depending on your computer’s operating system, there are various key mapping programs, each promising to provide a slightly different set of features while retaining the core functionality. We’ll go over these programs for all three major computer operating systems one-by-one.

Remapping a Key on Linux

Key-remapping on Linux is possible through both native utilities and third-party software. To keep things simple, though, we will use a third-party program called Key Mapper.

Key Mapper is an easy-to-use GUI tool for Linux that lets you change the mapping of input devices including keyboards, mice, gamepads, etc.

Download: Key Mapper (Free)

Follow these steps to use Key Mapper.

  1. After installing, open the terminal and type the following command to run Key Mapper: sudo key-mapper-gtk. If prompted, enter your root password and hit enter.
  2. In the Key Mapper window, click the dropdown button next to Device and select your device (keyboard).
  3. Click on the click here space below Key from the right pane and press the broken key you want to remap. Likewise, enter the key you plan on using as a replacement for the broken key in the mapping column.

    remapping a key using Key Mapper
  4. Hit Save from the left pane and click Apply to save your mapping.

With the broken key remapped, you can now enter the assigned key to get the corresponding output. A good thing about Key Mapper is that it creates a preset for every key mapping, so your mappings apply even after you reboot the system.

Moving forward, should you wish to remove your key mapping, you can delete the associated preset from Key Mapper to return keyboard input to its original state.

Remapping a Key on macOS

There are several key mapping tools for remapping keyboard keys on macOS. The one we will be demonstrating, however, is a GUI-based key mapping tool called Karabiner-Elements.

Karabiner-Elements works on both Intel-based and Apple Silicon Macs, and lets you modify the existing mapping rules or write your own.

Download: Karabiner-Elements (Free)

To remap a key with Karabiner-Elements on your Mac:

  1. After installing, open Karabiner-Elements and select the Simple modifications tab.
  2. Click the dropdown button below From key and select the broken key that you want to remap. Then click on the dropdown button below To key and choose the alternative to your broken key.
remapping a key using Karabiner-Elements

Once you add the key entries, the changes should take effect instantaneously, and you should be able to type the alternative key to get input for the broken key.

With the key remapping done, there are still a few things that you need to do.

  1. In the Karabiner-Elements app, go to the Function keys tab and ensure that every function key has the right action assigned to it. This is because Karabiner-Elements changes the default actions for some of the function keys, and this can cause confusion and hamper the keyboard’s functionality.
  2. Since the key remapping works only while Karabiner-Elements is running, we need to add Karabiner-Elements to the list of startup items so that it runs on every bootup.

That way, you do not have to open the app manually on each bootup to apply your key remapping changes.

Remapping a Key on Windows

Windows is the easiest to key remap of the lot, and there are many different programs that let you do so with ease. Some of these programs modify the system registry to permanently change the key bindings, while others take a different (read temporary) approach wherein they do not modify the registry.

Related: What Is the Windows Registry?

Of the various key mapper software in this category, the one we recommend is AutoHotkey, which does not modify the system registry.

Download: AutoHotkey (Free)

To use AutoHotkey to remap a key on Windows:

  1. Run AutoHotkey after installation. It runs in the background, so you need to check its status in the system tray before proceeding.
  2. Open your favorite text editor and create a new file. Enter the key mapping command in the following syntax – origin key::destination key, and save the file with the .ahk file extension in a secure location on your system. For example, if you need to remap the caps lock key as the shift key, your command should look like – CapsLock::Shift.

    remapping a key using AutoHotkey

Now, since we are using AutoHotkey to remap our keys and not actually remapping them permanently from the system registry, the remapping works only when AutoHotkey runs. So when you reboot your Windows computer, you need to run AutoHotkey manually every time. However, we can avoid this by putting our AutoHotkey script into Windows’ Startup folder.

  1. In Windows Explorer, copy the .ahk script file.
  2. Press Win + R to open the Run box and enter shell:startup
  3. In the Startup folder, right-click inside the window and select Paste Shortcut.

With your key remapping AutoHotkey script in the Startup folder, it should automatically execute every time your machine boots.

(An alternative solution is Microsoft PowerToys. However, since PowerToys is known to have issues with Windows updates, it is less reliable than AutoHotkey.)

Working Around a Broken Keyboard

By remapping a broken or missing key you can work around a broken keyboard until you get it repaired or replaced.

While there are numerous key mapping programs to do this, the ones we’ve discussed are easier to use and provide the essential functionality. When you get your keyboard repaired, each tool has an option to delete the mapping and return the keyboard to its default input state.

keyboard-windows-layout

Read Next

About The Author

.

Comments are closed.

error: Content is protected !!