The man page for keymaps(5) includes this quote:

Here's an example to bind the string "du\ndf\n" to the key AltGr-D. We use the "spare" action code F100 not normally bound to any key.

altgr keycode 32 = F100
string F100 = "du\ndf\n"

I created a file and copy & pasted those two lines, then ran

sudo loadkeys new_keymap

It completed without error, but AltGr-D still (either in Terminal or in LO Writer) printed the same character as before (an accented ‘o’).

What am I doing wrong?

What I’m really trying to do

I have a keyboard with some extra keys. The Mail key opens or restores my email client, Thunderbird – brilliant! I did nothing to configure this key, it worked immediately after I installed Linux Mint 19.1 Cinnamon.

The My Documents key does not work, nothing happens when it is pressed. I would like it to open the file manager (more precisely, to run the command nemo ~/Documents in Cinnamon).

showkey reports that Mail is scan code 155, and My Documents is 235.

Having found this answer https://stackoverflow.com/a/4200836/8557840 I created a keymap file containing

keycode 88 = F12
string F12 = "nemo "

but that does not change F12.

Changing the scan code to 235 does not affect the My Documents key.

I need to configure the keyboard.


What am I doing wrong?

You are erroneously expecting the keyboard map that is applied by the loadkeys program to the built-in terminal emulator in the kernel that handles kernel virtual terminals, to apply to X11 programs. You are configuring the wrong keyboard mapping. Configure your XKB mappings.

Further reading

  • Thank you for pointing out where I am going wrong. – Peter bill Apr 14 at 17:34

@JdeBP gave references that are very technical. After lots of reading, I found an easy way.

Menu→Preferences→Keyboard→Shortcuts→Custom Shortcuts→Add custom shortcut

There's a reference here: https://www.lifewire.com/how-to-change-the-linux-mint-cinnamon-keyboard-shortcuts-4064754

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.