Is there any way to disable the default behavior of the Insert key?

I keep hitting the Insert key accidentally and it really annoys me.

Is there any way to disable it's default behavior, toggling insert/overwrite mode in editors?


Solution 1:

Go to Keyboard Shortcuts in System settings, then press Add button and insert a Name of your choice, say "DisableIns", and true as a harmless command then press Apply button.

Now, in the Custom Shortcuts section you will find an entry

DisableIns | Disabled

Click on Disabled, then perform your custom shortcut Ins. Press close, you're done.

Solution 2:

I'm not sure it is the "right" way, but in my tests I could disable the behaviour of Insert using the following command:

$ xmodmap -e "keycode 118 ="

If this works for you, you could put the assignment in a file ~/.Xmodmap, i.e.

keycode 118 =

which should be loaded automatically at login. See questions here and here for more information about local xmodmap configuration.

Solution 3:

Type sudo nautilus in Terminal. Then go to /usr/share/X11/xkb/symbols and open pc. Then change this line:

key  <INS> {    [  Insert       ]   };

to

key  <INS> {    [  XF86Send     ]   };// Insert

Then run this:

sudo dpkg-reconfigure xkb-data

in Terminal and restart Ubuntu.

This will replace Insert with Send. You can replace it with any other appropriate key. To see a list of keys run this:

xmodmap -pke

Note: A mistake in editing pc. eg inserting an inappropriate character, may corrupt Ubuntu.