LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux Mint
User Name
Password
Linux Mint This forum is for the discussion of Linux Mint.

Notices


Reply
  Search this Thread
Old 06-03-2019, 02:06 PM   #1
ericlindellnyc
Member
 
Registered: Jun 2017
Posts: 181

Rep: Reputation: Disabled
Reassign broken Esc key in 19.1


Suggestions I found online to reassign keys in Linux either don't apply
  • to Mint 19.1; or
  • to ESC key.

How to re-assign my broken Esc key to any other key combination?
Thanks.

I have Cinnamon desktop.

Last edited by ericlindellnyc; 06-03-2019 at 02:11 PM. Reason: to specify Cinnamon desktop
 
Old 06-03-2019, 02:59 PM   #2
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Just so I understand correctly, your Esc key is broken and you want to program another key or key combination to generate Esc?
 
Old 06-03-2019, 06:12 PM   #3
ericlindellnyc
Member
 
Registered: Jun 2017
Posts: 181

Original Poster
Rep: Reputation: Disabled
Yes.
 
Old 06-04-2019, 05:34 AM   #4
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Ok, in that case, for a while (until I bought myself a new keyboard and installed it in my laptop), I had a very intermittent "i" key so reprogrammed the F9 key to produce "i"'s in a Linux Mint 19 system. Here's how I did it:

I first ran the following command and pressed the relevant keys to find out the keycodes for the "i" key and the "F9" key:

Code:
xev | grep -A2 --line-buffered '^KeyRelease' | sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p'
This resulted in "i": 31 and "F9": 75. In your case, on my system, "Escape" is 9.

I then ran the following to determine the exact text in the lines relating to both these keys:

Code:
xmodmap -pke
After that, I ran the following command to create a file to override the specific xmodmap setting for F9, populating it with the "i" line obtained above but replacing its keycode with the keycode for F9. I then saved and closed the file.

Code:
sudo xed ~/.Xmodmap
I tested this with:

Code:
xmodmap ~/.Xmodmap
This setting gets lost on reboot/shutdown so in order to change it on every system startup, I added the following command to my startup applications:

Code:
bash -c "sleep 10 && /usr/bin/xmodmap /home/$USER/.Xmodmap"
Let me know how you get on.
 
  


Reply

Tags
keyboard



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
A way to change 'Esc' key to '~' key in the keyboard? stf92 Linux - Newbie 4 03-24-2013 07:28 PM
How to reassign backspace key? skykooler Linux - Hardware 2 10-26-2010 12:16 PM
reassign /var space to / vikesh.u Ubuntu 2 09-09-2009 01:34 AM
PHP - dynamically create folder and reassign ownership adymroxx Programming 6 05-02-2009 04:48 PM
Reassign mouse buttons FrozenBacon Slackware 1 03-26-2007 02:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux Mint

All times are GMT -5. The time now is 04:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration