0

Actually my problem is same with this How to disable a keyboard key in Linux (Ubuntu)?

But I want to disable this corrupted key( keycode is 135) on startup.

xmodmap -e 'keycode 135= NoSymbol'

Although I tried a lot of methods, I could not run the above command on startup.

I tried these methods;

  • I added the above command into /etc/rc.local but it doesn't work!

  • I created a bash script and then I moved my script into /etc/init.d/ and I enabled it on startup with this command update-rc.d disablekey.sh enable but it doesn't work!

  • I found a service postgresql in /etc/init.d/ and I added this xmodmap -e 'keycode 135= NoSymbol' command in postgresql service and then I run this command update-rc.d postgresql enable When I rebooted my computer. The postgresql service runs okay but my corrupted key still works.

any suggestions?

  • I think running `xmodmap` before X starts is futile, it returns `unable to open display`. You have to have display first. I would try to run the command just before any display manager (like LightDM) starts. I haven't tested this though, hence this is a comment, not an answer. – Kamil Maciorowski Jan 23 '18 at 12:42

1 Answers1

0

Try to create file ~/.Xmodmap

keycode 135 = NoSymbol

and reboot.

  • Seems like a good clue but since this file is inside the home directory, I expect the change will take effect after the particular user logs in. OP's malfunctioning key is "always pressed" and this will probably interfere with entering password etc. "Activating the custom table" section in [this document](https://wiki.archlinux.org/index.php/xmodmap#Activating_the_custom_table) mentions editing the global startup script. This may be the right way if my concern is justified. It also ties in with my previous comment (under the question). – Kamil Maciorowski Jan 25 '18 at 06:22