Skip to main content

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.

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.

Comments

Popular posts from this blog

The Best 10 Social Media Platforms for Photographers to Flaunt Their Talent

Social media offers an excellent opportunity for photographers to connect with potential clients. In the digital era, it's a great asset. By showcasing your work on these networks, you can reach new audiences. Whether you are a professional or freelance photographer, the following social platforms will help you show off your work and get the right people to take notice... 1. Behance Behance is a classic portfolio publishing network that functions like a LinkedIn for creatives. Designed by Adobe, this is one of the best photography networking sites currently out there. The platform is ideal for sharing your portfolio and favorite images, allowing other Behance users to like and comment on your photos. By learning from their feedback and professional critiques, you can improve your work. The coolest feature of Behance is that it lets you find professional gig opportunities right on the platform. With your portfolio already available on the site, getting work becomes effortless.

The 6 Best Platforms for Sharing Your Digital Art Online

Whether you're looking for somewhere to host your digital art portfolio or simply want to share your latest artworks, it can be difficult to choose a website to upload to. Or at least, it definitely is more so than before, now that art websites aren't bubbling with as much excitement as they used to be. You know that each site has its pros and cons, but it's hard to figure out what those are unless you make an account and see for yourself. Don't worry if you don't have time for that—we've got your back. Here are the websites we recommend for sharing digital art, and why you might want to consider them. 1. Pixiv If you were around when the online art scene was ridiculously active, chances are that your art style is influenced by anime and/or manga in some way. Otaku culture began its slow sneak into mainstream media back then, and Pixiv is a great home for artists that fall in that category. Pixiv started as a small online community based in Japan, but has s

Snapchat Suspends Two Anonymous Messaging Apps Over Cyberbullying Claims

In light of a lawsuit that was filed earlier, two Snapchat apps, Yolo and LMK have been suspended by Snap. The apps allowed users to send anonymous messages on the platform. The Lawsuit Calls for an Immediate Ban of Yolo and LMK According to a LA Times report, the lawsuit was filed on behalf of Kristin Bride, the mother of a teen who committed suicide in 2020. The lawsuit alleges that Bride's son took his own life after being cyberbullied via Yolo and LMK. In addition to this, the lawsuit alleges that Yolo and LMK aren't doing enough to tackle cyberbullying, and have consequently violated consumer protection law as well as their own terms of service and policies. Both apps use Snap Kit, a set of tools that allows developers to directly connect to Snapchat for better integration features. Today the family of a 16-year-old Oregon boy who took his own life after being cyberbullied sued Snap and the makers of apps YOLO and LMK, alleging that the companies should be "h