Add keyboard shortcut for Enter

Please post suggestions for improvement of Cinnamon on:
https://github.com/linuxmint/Cinnamon
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
DeltaTango
Level 2
Level 2
Posts: 94
Joined: Tue May 10, 2016 4:25 am

Add keyboard shortcut for Enter

Post by DeltaTango »

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 ?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
magnus7
Level 4
Level 4
Posts: 359
Joined: Sat Jan 30, 2016 8:46 pm

Re: Add keyboard shortcut for Enter

Post by magnus7 »

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: 94
Joined: Tue May 10, 2016 4:25 am

Re: Add keyboard shortcut for Enter

Post by DeltaTango »

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 4
Level 4
Posts: 359
Joined: Sat Jan 30, 2016 8:46 pm

Re: Add keyboard shortcut for Enter

Post by magnus7 »

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: 94
Joined: Tue May 10, 2016 4:25 am

Re: Add keyboard shortcut for Enter

Post by DeltaTango »

It worked ! Awesome !
Thanks a lot
Locked

Return to “Cinnamon”