Add keyboard shortcut for Enter

Please post suggestions for improvement of Cinnamon here
https://github.com/linuxmint/Cinnamon
Post Reply
DeltaTango
Level 2
Level 2
Posts: 71
Joined: Tue May 10, 2016 4:25 am

Add keyboard shortcut for Enter

Post by DeltaTango » Tue Nov 13, 2018 5:10 am

Hello.

I have a problem with the keyboard of my MSI laptop running LM 19: the Enter key does not work any more.
It will go to customer service and repair and in the meantime I am using an USB keyboard.
But before it is fixed, I have a couple of trips to do with this laptop.

Hence, I would like to map a keyboard shortcut for Enter , globally (for all applications, including the terminal emulator).

I have seen I might be able to do this under Settings > Keyboard > Shortcuts > Custom Shortcuts.
But which command do I enter there in the dialogue window ?

magnus7
Level 3
Level 3
Posts: 138
Joined: Sat Jan 30, 2016 8:46 pm

Re: Add keyboard shortcut for Enter

Post by magnus7 » Tue Nov 13, 2018 8:10 am

Remapping a key in keyboard layout will be a better solution. For example, Scroll Lock key is disabled in almost all layouts in LM. You can enable it and remap to Enter. Run this command in terminal and restart the computer:

Code: Select all

sudo sed -i \
-e '71s|.*|key<SCLK>{[Return]};|' \
-e '71 a modifier_map Mod3 {Scroll_Lock};' \
/usr/share/X11/xkb/symbols/pc \
&& sudo dpkg-reconfigure xkb-data

DeltaTango
Level 2
Level 2
Posts: 71
Joined: Tue May 10, 2016 4:25 am

Re: Add keyboard shortcut for Enter

Post by DeltaTango » Tue Nov 13, 2018 9:19 am

Thanks for your help.

This sounds like a good option .. except I cannot see any Scoll lock key on my keyboard.
The laptop is a MSI GS65 8RE-052FR Stealth Thin.
Ideally, I would liek to map it to the right Shift key that is right below the Enter key. Otherwise, the $ key.

Is there a list of the various key names somewhere (such as 'Scroll_Lock' ) ?
And when I have the keyboard fixed, how do I undo this ?

magnus7
Level 3
Level 3
Posts: 138
Joined: Sat Jan 30, 2016 8:46 pm

Re: Add keyboard shortcut for Enter

Post by magnus7 » Wed Nov 14, 2018 6:11 am

Command for Right Shift key:

Code: Select all

sudo sed -i '29s|.*|key<RTSH>{[Return]};|' \
/usr/share/X11/xkb/symbols/pc \
&& sudo dpkg-reconfigure xkb-data
To undo remapping reinstall xkb-data package. In terminal:

Code: Select all

sudo apt-get install --reinstall xkb-data

DeltaTango
Level 2
Level 2
Posts: 71
Joined: Tue May 10, 2016 4:25 am

Re: Add keyboard shortcut for Enter

Post by DeltaTango » Wed Nov 14, 2018 7:33 am

It worked ! Awesome !
Thanks a lot

Post Reply

Return to “Cinnamon”