FOSSPicks
Map buttons
Key Mapper
As someone who uses an older MacBook Pro with Linux natively installed, it's imperative that Apple's special Control and Option keys are mapped to work with Linux effectively. This is a rather arcane two-step process, first because you run the ancient xv
command to divine the raw keycodes for those keys, and second because you enter those keycodes into an equally ancient xmodmap
file to map those raw keycodes into key presses. As the x
in both tools suggest, this process is unlikely to work with Wayland. Key Mapper is a Python application with a modern GTK+ front end that does all this easily and adds the ability to map buttons and keys from almost any input device. This is the clever part, because input devices can include joysticks and controllers, as well as keyboards, which you select from the device drop-down at the top of the window. With a device selected, you use the key pane on the right to press the input you want mapped before selecting from a drop-down list what you want it mapped to. This list is absolutely huge and includes all the XF86 shortcuts, as well as triggers, special keys, and touchpad controls.
If you're mapping a games controller, you can map its joysticks to mouse movement, the mousewheel, buttons, or a single joystick, complete with mouse speed. This is brilliant if you're building a Linux arcade machine, for example and want the joystick to control the mouse cursor while at the same time mapping some of the buttons to launch the games you want. This entire configuration can be saved as a preset for easy recall, and you can have as many presets as you need. Presets are useful if you want to step away from the computer, for example, and control it remotely, or if you switch keyboards between an Apple keyboard on the road and a more conventional keyboard when you're home. A background daemon is also installed and activated by default, and this takes care of the changing configuration, as well as making any necessary changes when you reboot. It works perfectly.
Project Website
https://github.com/sezanzeb/key-mapper
macOS shortcuts
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Gnome 48 Debuts New Audio Player
To date, the audio player found within the Gnome desktop has been meh at best, but with the upcoming release that all changes.
-
Plasma 6.3 Ready for Public Beta Testing
Plasma 6.3 will ship with KDE Gear 24.12.1 and KDE Frameworks 6.10, along with some new and exciting features.
-
Budgie 10.10 Scheduled for Q1 2025 with a Surprising Desktop Update
If Budgie is your desktop environment of choice, 2025 is going to be a great year for you.
-
Firefox 134 Offers Improvements for Linux Version
Fans of Linux and Firefox rejoice, as there's a new version available that includes some handy updates.
-
Serpent OS Arrives with a New Alpha Release
After months of silence, Ikey Doherty has released a new alpha for his Serpent OS.
-
HashiCorp Cofounder Unveils Ghostty, a Linux Terminal App
Ghostty is a new Linux terminal app that's fast, feature-rich, and offers a platform-native GUI while remaining cross-platform.
-
Fedora Asahi Remix 41 Available for Apple Silicon
If you have an Apple Silicon Mac and you're hoping to install Fedora, you're in luck because the latest release supports the M1 and M2 chips.
-
Systemd Fixes Bug While Facing New Challenger in GNU Shepherd
The systemd developers have fixed a really nasty bug amid the release of the new GNU Shepherd init system.
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.