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

64 Best Free WordPress Blog Themes for 2020

Are you looking for a free WordPress blog theme for your website? There are thousands of free blog themes for WordPress, making it hard for beginners to choose between all the different options. The best WordPress themes can be tough to find. Your free theme needs to be reliable and easily customizable. In this article, we have hand-picked some of the best free WordPress blog themes that you can use on your site. Getting Started with WordPress First, you need to make sure that you are using the best blogging platform . Self-hosted WordPress.org is the perfect platform to start your blog because it gives you lots of freedom, flexibility, and control. We have a useful guide on the difference between WordPress.org and WordPress.com . WordPress.org is open source. It comes with support for thousands of free templates (called themes) and extensions (called plugins) that help you grow your blog faster. Take a look at our article on why you should use WordPress to learn more. You can...

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. ...

25 Awesome iPhone App Icon Packs to Customize Your Home Screen

With the release of iOS 14, Apple made it possible to customize the app icons on your iPhone's Home Screen without worrying about duplicates. Of course, most of us aren't graphic designers, so we need to rely on iOS app icon packs made by other people to change the look of our Home Screen. We've scoured the web to find the coolest, most unique, and best-designed iOS app icon packs for you to download. Before You Customize Your iOS App Icons There are a few important points you need to know before you customize the app icons on your iPhone Home Screen: It's time-consuming: For every app icon you want to change, you need to create a new shortcut in the Shortcuts app, then add it to your Home Screen and hide the original app. If you have a lot of apps, this could take hours. Custom icons don't show notification badges: Customized app icons act as a shortcut to the original app. For this reason, they don't show red notification badges like normal apps. The o...