Q: How can I disable one or several keys of my laptop keyboard in Linux? When I press DELETE key it gets stuck and deletes everything :)

A: No problem! You can use the following command to remap or disable any key of your keyboard:

xmodmap -e 'keycode <value>=<action>'

For example, run the following to disable your DELETE key: xmodmap -e 'keycode 107='. BTW you can get keycode that corresponds to certain keyboard button by using simple command xev

xev

The full list of available keycodes and actions assigned to them on UK keyboard is below…

keycode 8 =
keycode 9 = Escape
keycode 10 = 1 exclam
keycode 11 = 2 quotedbl
keycode 12 = 3 sterling
keycode 13 = 4 dollar
keycode 14 = 5 percent
keycode 15 = 6 asciicircum
keycode 16 = 7 ampersand
keycode 17 = 8 asterisk
keycode 18 = 9 parenleft
keycode 19 = 0 parenright
keycode 20 = minus underscore
keycode 21 = equal plus
keycode 22 = Delete
keycode 23 = Tab
keycode 24 = Q
keycode 25 = W
keycode 26 = E
keycode 27 = R
keycode 28 = T
keycode 29 = Y
keycode 30 = U
keycode 31 = I
keycode 32 = O
keycode 33 = P
keycode 34 = bracketleft braceleft
keycode 35 = bracketright braceright
keycode 36 = Return
keycode 37 = Control_L
keycode 38 = A
keycode 39 = S
keycode 40 = D
keycode 41 = F
keycode 42 = G
keycode 43 = H
keycode 44 = J
keycode 45 = K
keycode 46 = L
keycode 47 = semicolon colon
keycode 48 = apostrophe at
keycode 49 = grave asciitilde
keycode 50 = Shift_L
keycode 51 = numbersign asciitilde
keycode 52 = Z
keycode 53 = X
keycode 54 = C
keycode 55 = V
keycode 56 = B
keycode 57 = N
keycode 58 = M
keycode 59 = comma less
keycode 60 = period greater
keycode 61 = slash question
keycode 62 = Shift_R
keycode 63 = KP_Multiply
keycode 64 = Alt_L
keycode 65 = space
keycode 66 = Caps_Lock
keycode 67 = F1
keycode 68 = F2
keycode 69 = F3
keycode 70 = F4
keycode 71 = F5
keycode 72 = F6
keycode 73 = F7
keycode 74 = F8
keycode 75 = F9
keycode 76 = F10
keycode 77 = Num_Lock
keycode 78 = Scroll_Lock
keycode 79 = Home KP_7 KP_7 Home
keycode 80 = Up KP_8 KP_8 Up
keycode 81 = Prior KP_9 KP_9 Prior
keycode 82 = KP_Subtract
keycode 83 = Left KP_4 KP_4 Left
keycode 84 = Begin KP_5 KP_5 Begin
keycode 85 = Right KP_6 KP_6 Right
keycode 86 = KP_Add
keycode 87 = End KP_1 KP_1 End
keycode 88 = Down KP_2 KP_2 Down
keycode 89 = Next KP_3 KP_3 Next
keycode 90 = Insert KP_0 KP_0 Insert
keycode 91 = Delete KP_Decimal KP_Decimal Delete
keycode 92 = 0x1007ff00
keycode 93 =
keycode 94 = backslash bar
keycode 95 = F11
keycode 96 = F12
keycode 97 = Home
keycode 98 = Up
keycode 99 = Prior
keycode 100 = Left
keycode 101 = Begin
keycode 102 = Right
keycode 103 = End
keycode 104 = Down
keycode 105 = Next
keycode 106 = Insert
keycode 107 = Delete
keycode 108 = KP_Enter
keycode 109 = Control_R
keycode 110 = Pause
keycode 111 = Print
keycode 112 = KP_Divide
keycode 113 = Mode_switch
keycode 114 = Break

Information improvisation: Get free demos for http://www.braindumps.com/JN0-343.htm exam and http://www.pass4-sure.us/640-911-dumps.html with 100% guaranteed success. Our best quality http://www.test-king.com/exams/312-50v8.htm prepares you well before appearing in the final exams of https://www.isaca.org/ & http://www.actualtests.com/exam-312-50v8.htm Best wishes.

 

19 Comments

 

  1. October 13, 2008  3:54 am by Stephan H. Wissel Reply

    Very nice. Could you also share how to assign stuff to key combinations like F1

  2. October 13, 2008  3:58 am by Stephan H. Wissel Reply

    aarg... it did eat my comment. I meant to key combinations like [Super][Shift]F1

    (and your anti-spam word is hidden when it recognizes a previous comment)

  3. June 11, 2009  8:02 pm by rahul Reply

    Many Thanks for this,

    Could you please also let us know, how to re-enable the keyboard key. I disabled the down arrow key and it disabled for my both laptop keyboard and the external keyboard. But I want my external keyboard key enabled. How can i re-enable it?

    Many Thanks

  4. December 19, 2009  8:23 pm by cheap resveratrol Reply

    Comfortabl y, the article is really the freshest on this worthw hile topic. I concur with your conclusions and will thirstily look forward to your next updates. Just saying thanks will not just be enough, for the fantasti c lucidity in your writing. I will directly grab your rss feed to stay abreast of any updates. Fabulous work and much success in your business efforts!

  5. March 26, 2010  2:38 am by Math Reply

    This a lot, This aricle save me lot of time. Mapping keyboard key is really an awesome idea.

  6. March 26, 2010  9:37 pm by sycleeageshog Reply

    Earth Hour in 2010 happens on Saturday 27 March and is usually a global call to action to each and every man or women, just about every organization along with each and every neighborhood throughout the world.







    Are going to you take part in it?

  7. April 3, 2010  10:39 am by sukandi Reply

    really cool man...

    thank. ^^

  8. April 14, 2010  7:33 am by Lisa Reply

    How do you save the keys you want to change? my n and b are broken...

  9. May 15, 2010  7:22 pm by Foxnewbee Reply

    Excuse me. Does anybody realize how to find true Forex Expert Avisor from fake and a true trading signals from fraudulent? sorry for inconvinience

  10. October 9, 2010  5:32 pm by Artaxerxes Reply

    I did this, but the keys reset themselves after each reboot. What could be the problem?

  11. November 24, 2010  11:24 pm by Diego Reply

    Thanks a lot for the tip, my IBM Thinkpad has this page forward/back keys that are so annoying when typing an email, they can be easily pressed by accident and navigate away from the page, thus loosing the written text... and they are now disabled on my .profile :D

  12. Pingback : down arrow key somehow mismapped or something

  13. March 7, 2011  4:25 am by Plantar Fasciitis Treatment Reply

    This constantly amazes me just how blog owners for example your self can find the time along with the commitment to carry on crafting remarkable blog posts. Your website isterrific and one of my personal have to read weblogs. I simply want to thank you.

  14. May 12, 2011  10:09 pm by Ruben Stefan Reply

    The only thing that seems to be missing here is that plugin that allows you to interlink your blog content, cloak affiliate links (or any other links), add the no follow attribute and stuff like that. This is actually a pretty powerful little tool and it does much more than just create links on a blog. It's great for creating affiliate links but it is also a powerful SEO tool as it can automatically interlink the page and posts on a blog with different anchor texts. by varying the link anchor texts and linking to deeper pages in the site, you should be able to see some improvements in your overall search engine rankings. It's really a nifty little piece of software and a 'must have' for any blogger. This plugin is already being used by thousands of casual bloggers, Internet marketers and professional SEO agencies. Check it Out -> http://adf.ly/1Txj0

  15. May 17, 2011  5:17 am by Sook Oshinsky Reply

    The excellent summary encouraged me very much! Saved the website, very great topics everywhere that I see here! I really appreciate the information, thanks.

  16. April 10, 2012  10:28 am by shark Reply

    Thanks a lot! You save my life a netbook. .)

  17. February 17, 2013  4:12 am by chicago best restaurants with kids Reply

    Arlington Heights, the news show up on Hither since I'm updating roughly vegan restaurants! Old and new assorted some of the finest dining establishments in the existence, chicago restaurants precisely can't be lost.

  18. Pingback : A way to change 'Esc' key to '~' key in the keyboard?

  19. May 24, 2013  11:12 am by Ade Malsasa Akbar Reply

    Thank you! This key list was very helpful for me. My keyboard gone wrong and I can remap it in Linux EASILY by looking at this list.

    Thank you.

Leave a reply

 

Your email address will not be published.