0

The Space key on my keyboard has given up soI want to change 'Alt' (left) to 'Space' and 'CapsLock' to 'Alt'.

In /usr/share/X11/xkb/symbols/pc I have changed the lines

//key <CAPS> {  [ CapsLock              ]   };
key <CAPS>   {  [ Alt_L                 ]   };
//key <ALT>  {  [ NoSymbol, Alt_L       ]   };
key <ALT>    {  [ space                 ]   };
//include "altwin(meta_alt)"

I have 'updated' the cache in cd /var/lib/xkb with sudo rm *.xkm and restarted the computer.

After the restart, the Alt key doesn't act as the Space key but also it doesn't act as the Alt key. So, all the commands like CTRL + Alt + T are no longer working.

Also, the CapsLock doesn't act as the Alt key, it doesn't do anything.

HOWEVER, if I set CapsLock to 'Space' in /usr/share/X11/xkb/symbols/pc CapsLock acts as 'Space' key without any issues.

I use the UK keyboard layout in Ubuntu.

Any idea why the 'Alt' key won't act as the Space key?

JoHKa
  • 597
  • 2
    Maybe set the key <LALT> rather than <ALT>. See also the altwin symbols file. – Gunnar Hjalmarsson Nov 27 '17 at 18:19
  • In the file, the designation of ALT is ALT ..by default and the 'definition' is Alt_L. I will try that later on though and report on here. – JoHKa Nov 28 '17 at 17:02
  • Gunnar - please write your suggestion as a reply to my question, <LALT> has worked and solved the problem! I would like to accept it 'officially'. – JoHKa Dec 07 '17 at 22:10
  • Great that it worked. Please note that my comment was just an untested hint. Better that you post an answer yourself, and explain more specifically how you made it work. It's perfectly fine to answer your own question. :) – Gunnar Hjalmarsson Dec 07 '17 at 22:21
  • Gunnar - okay, I will put in an answer and explain what I did, referring to your comment. Two quick questions though: 1) How did you come up with the 'LALT' designation, there is no 'LALT' designation in the original file. 2) In case that I wanted to use the 'Alt_Gr' key as the space key, which designation would you recommend. There is no 'Alt_Gr' line in the original file? – JoHKa Dec 12 '17 at 06:02
  • I knew that LALT is used in other files, 2. RALT
  • – Gunnar Hjalmarsson Dec 12 '17 at 10:54
  • Thanks a lot. ...Just for the records, so that other people know: RALT doesn't work. – JoHKa Dec 12 '17 at 21:21
  • Ok.. Try ISO_Level3_Shift then: pls see https://askubuntu.com/a/936983/159370 – Gunnar Hjalmarsson Dec 13 '17 at 00:10