Key mapping in linux

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

🎮 An easy to use tool to change the mapping of your input device buttons.

License

tmclane/key-mapper

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

An easy to use tool to change the mapping of your input device buttons.
Supports mice, keyboards, gamepads, X11, Wayland, combined buttons and programmable macros.
Allows mapping non-keyboard events (click, joystick, wheel) to keys of keyboard devices.

Get a .deb file from the release page or install the latest changes via:

sudo apt install git python3-setuptools gettext git clone https://github.com/sezanzeb/key-mapper.git cd key-mapper && ./scripts/build.sh sudo apt install ./dist/key-mapper-1.2.1.deb
sudo pip install --no-binary :all: git+https://github.com/sezanzeb/key-mapper.git sudo systemctl enable key-mapper sudo systemctl restart key-mapper

If it doesn’t seem to install, you can also try sudo python3 setup.py install

About

🎮 An easy to use tool to change the mapping of your input device buttons.

Источник

Key Mapper: a visual tool for remapping keys (and more) on Linux

Screenshot of the Key Mapper application running in dark mode. The Device selection box reads Topre Corporation Realforce 87. The interface has buttons for Restore Defaults, Apply, Copy, New, Delete. On the left-hand side form, a selection box labelled Preset has Typography selected. Under that, a rename text box is empty (with an action button next to it). Finally, there’s an Autoload switch that’s on. On the right-hand side, there is a two column table, headings: key, mapping. There are four mappings: (key) ISO Level3 Shift + bracketLeft → (mapping) ISO_Level3_Shift + Shift_R + v, ISO Level3 Shift + bracketRight → (mapping) ISO_Level3_Shift + Shift_R + b, (key) ISO Level Shift + semicolon → (mapping) ISO_Level3_Shift + v, (key) ISO Level Shift + apostrophe → (mapping) ISO_Level3_Shift + b

16 Aug 2021

I’m a bit particular when it comes to typing.

Specifically, I like to use good typographical habits whenever possible.

Читайте также:  Directory services for linux

And, I use an external keyboard with a physical ANSI US Keyboard layout set to UK Macintosh layout on my Linux laptop 1 . So, I need to reclaim my backtick/tilde key.

Previously, I used a combination of xmodmap , xev , and a .desktop in autostart to handle the backtick/tilde issue – which was about as fun as it sounds to figure out and implement – and the standard Alt Graph modifiers for things like typographical quotes. And while the AltGr modifiers are great and all, they weren’t entirely ergonomic.

When I was on a Mac, I used an awesome tool called Karabiner-Elements to handle all this with a minimum of fuss.

Surely it shouldn’t be this hard to remap your keys in Linux in 2021! Well, thanks to an app I just discovered called (wait for it) Key Mapper, it’s not.

Mapping keys for fun and pedantry

Using Key Mapper is fairly straightforward.

Once you’ve installed 2 and launched it, you’re greeted with a simple interface where you can select the device 3 you want to create mappings for.

From there, you can create a new set of mappings, give them a name (confusingly in a separate text box called rename) and choose whether they should auto load. 4

Finally, you create the mappings themselves by first pressing the key or key combination you want to map and then entering the codes of the key(s) you want them to map to.

Note that you are mapping keys to keys, not keys to characters. The distinction is important. So, for example, to map you’re mapping AltGr + [ to AltGr + Shift + v , not AltGr + [ to ‘ .

Or, more precisely, using the key names used by Key Mapper, you’re mapping ISO Level3 Shift + bracketleft to ISO_Level_3_Shift + Shift_R + v .

Niggles

Key Mapper is great but it’s not perfect. Here are a few niggles I’ve noticed:

  • There is a noticable delay of about a second when a mapping fires. This could get annoying fast (and wasn’t an issue with the manual way I was doing mappings earlier).
  • The mappings didn’t survive suspend. It remains to be seen if that was a one-off or if it keeps happening.
  • There doesn’t seem to be a way to use a preset from one device on another. Case in point: I wanted to use the same mappings on my external keyboard and on the laptop keyboard so I had to create them twice. Not a huge problem for a handful of mappings but it could be more of a headache for larger lists.

A great start

Having a graphical key mapper in Linux is great. Here’s hoping that some of the niggles are not facts of life and can be improved upon with time.

Worst case scenario, I’ll have to hunt down how I was doing things in the past and reimplement that on my new elementary OS 6 installation. 5

Читайте также:  Ноутбук асер установка линукс

Aral Balkan

  1. Hey, don’t judge me! ↩︎
  2. I just grabbed the .deb file from their releases page. ↩︎
  3. You’re not limited to keyboards; you can remap keys on mice and gamepads. Key Mapper also states that it works on X11 and Wayland, although I’ve only tested it under X11. And, though I haven’t used them yet, you can also use macros. ↩︎
  4. In my limited testing so far, auto-loading seems to survive sleep for me but it did fail once after a suspend. Getting mappings to stick was also an issue with my homebrew system previously and I don’t remember how I finally managed to make it work reliably at both sign in and after sleep/suspend. I may have to hunt down my backup configuration files or re-read my blog posts that I linked above if this becomes a headache. ↩︎
  5. I plan on writing a comprehensive post on elementary OS once I’ve got my laptop back to running the way I want it to under version 6/Odin. ↩︎

About the author

I’m an activist, designer, and developer. I’m one-half of Small Technology Foundation, a tiny and independent two-person not-for-profit based in Ireland. We advocate for and build small technology to protect personhood and democracy in the digital network age.

© 2001- Aral Balkan. View source. Unless otherwise stated, all source code is licensed under GNU AGPL version 3.0 and all other post content is licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-NC-SA 4.0). Built with Hugo and running on Site.js.

Источник

Remap Keyboard And Mouse Buttons On Linux With The New Input Remapper GUI (Supports X11 And Wayland)

Key Mapper Linux GUI

The application supports per-device presets, and it allows using timed macros with the ability to repeat keys, wait between keys, hold a modifier while using a key, and more. Besides keyboards and mice, Input Remapper also comes with basic support for gamepads.

Other features include support for stopping any mappings and using system defaults for a device (using the Apply Defaults button), and support for automatically loading presets on login for plugged in devices. Also, Input Remapper uses evdev to read keycodes and display them inside the application, so the user doesn’t have to do this manually.

The application does not support binding commands or scripts to keyboard or mouse buttons. For that, see this article from Linux Uprising.

For future releases, the developer plans to add support for mapping D-Pad and Joystick directions as buttons, automatically loading presets when a device is plugged in after login, and mapping a combined button press to a key.

[[Edit]] Input Remapper has been updated with support for mapping joysticks like D-Pads, support for mapping the mouse wheel, key combinations, and loading presets automatically when devices are connected, even after login.

How to remap keyboard and mouse buttons on Linux using Input Remapper (ex Key Mapper)

Using Input Remapper you can assign the action associated with a keyboard or mouse button (or multiple buttons) to a different button. You may also use it to assign a macro (a sequence of button presses / actions) to a key.

Читайте также:  Linux find directory by name recursively

The first time you run Input Remapper, you’ll want to select the device (mouse or keyboard) from the device dropdown. Choose a device, and you can start creating a new preset to easily remap your keyboard or mouse buttons.

Left-click in the Key column, then press the keyboard key or mouse button you want to remap, and it will show up in the key box. In case this doesn’t work, you may need to click the Apply Defaults button that’s displayed to the right-hand side of the device dropdown, and add the key after that.

After you enter the key (or keys) you want to remap, it’s time to decide its mapping. Click inside the Mapping cell corresponding to the key you want to remap, then start typing what you want to remap the button to. You can type the first few letters instead of the whole word, e.g. you can type «con» and a dropdown should show the available options, like control_l , control_r , etc:

Once you’ve completed the mappings, click the Save button. And finally, click Apply to start using the new mappings. You must first Save the new mappings, then click the Apply button, or else the changes won’t have any effect!

It’s worth noting that using key combinations as mappings isn’t as straightforward as you may think, at least not using the latest release (because as I already mentioned, mapping a combined button press to a key is on the todo list). For example if you want to use Ctrl + F1 as the mapping for a key, adding control_l+f1 to the Input Remapper Mapping column won’t work. Instead, you’ll need to use this macro as the mapping: m(control_l, k(f1)) .

For how to use macros, check out the Input Remapper macro documentation, which also includes a few examples.

Download Input Remapper (previouslt Key Mapper)

Input Remapper can be installed easily on Debian / Ubuntu and Linux distributions based on these (like Linux Mint, Pop!_OS, Zorin OS, Elementary OS, etc.) by using the DEB package that can be downloaded from the application releases page.

Arch Linux and Manjaro users can install Input Remapper by using an AUR package.

You may also install Input Remapper using PIP as explained here, which works on any Linux distribution (I don’t recommend using PIP with sudo though; also, on some Linux distributions you’ll need to use pip3 instead of pip , since this needs Python 3).

You might like:

Источник

Оцените статью
Adblock
detector