This key is close to others on my keyboard which contributes to some accidental key presses. I would like this key to be a no-op. I am mainly interested in a solution that works when I log in via Unity desktop. Gnome-terminal is a critical app where this causes me problems. I don't log into TTY very often, so I don't think I need a solution that works in that domain if it is different from the Unity desktop.

  • A no-op where? In the UI, Terminal, TTY? Everywhere??? (The solution depends on this) – Fabby Feb 20 '15 at 15:19
  • I updated the question to rule out TTY if that complicates things. Thanks! – Setjmp Feb 20 '15 at 17:13
  • Do you use multiple keyboard lay-outs? (and no: everywhere is easier then "somewhere") ;-) – Fabby Feb 20 '15 at 17:22
  • All of my keyboards are US QWERTY. However, there are different keyboards I use to interact with this machine. One is a Goldtouch keyboard that is directly plugged in. Another is a attached to my mac laptop that I use in the context of remote desktop. The Mac keyboard gives me no problems. I also have a Goldtouch keyboard at home (similar to my office one) that I use when plugging the Macbook into my home KVM switch. – Setjmp Feb 20 '15 at 17:27
  • Oh, it's a Mac... Sorry, I won't be able to help you then... I know nothing about Mac keyboards. – Fabby Feb 20 '15 at 17:29

To add context to SetJmp's answer in case you don't want to read through UbuntuForums:

  1. Run xev in a terminal
  2. Press the key that you want to disable (in this case, num lock). Note the keycode (in my case, 77)
  3. Run xmodmap -e 'keycode number = NoSymbol'. In my case, this was xmodmap -e 'keycode 77 = NoSymbol'

I haven't tested if the keycode is standard across computers or if additional steps are needed to make it persist across reboots.

  • 77 on my dell laptop too. According to that linked forum discussion "To make it permanent, put this command in the System, Preferences, Sessions, Startup Programs folder, Add." – EricS Dec 24 '16 at 1:12
  • To start "Startup Applications Preferences", press ALT + F2 and run gnome-session-properties. – Tzunghsing David Wong Aug 25 '18 at 1:19

I found this approach helpful:


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.