10

I've just spent a good while trying to make this happen, but I'm just stuck on the basic hello world example.

I've navigated to /usr/share/X11/xkb/symbols and edited the us file (since I use a standard us keyboard) and changed the first instance of

key <AC08> { [ k, K ] };

into

key <AC08> { [ k, K, A ] };

I also deleted the .xkm files in /var/lib/xkb and rebooted. According to

https://help.ubuntu.com/community/Custom%20keyboard%20layout%20definitions?action=show&redirect=Howto%3A+Custom+keyboard+layout+definitions

I should now expect to see a capital A upon rightalt+k, but I get nothing.

dlin
  • 3,740
  • 3
  • 29
  • 45
user2347229
  • 101
  • 3
  • 1
    Possible duplicate of [How can I change what keys on my keyboard do? (How can I create custom keyboard commands/shortcuts?)](http://askubuntu.com/questions/254424/how-can-i-change-what-keys-on-my-keyboard-do-how-can-i-create-custom-keyboard) – Fabby Apr 12 '17 at 22:30
  • 2
    I have the same problem and no progress. It is fascinating how difficult such a simple thing is. – user3496846 May 19 '17 at 18:14
  • @user3496846 quiet late, but I posted a solution that should work and tested it some time before. – user.dz Sep 22 '21 at 17:11

1 Answers1

0

Short answer: You need to set/activate 3rd level shift (Default is: AltGr / Right Alt)

So use my answer here as reference which also explains it.

  1. Declare either 2, 4, 8, i don't know if it will work otherwise

    key <AC08> {   [     k,    K,    a,    A]   };
    
  2. Add this line at the end, to activate RAlt as 3rd level shift

    level3(ralt_switch)
    
  3. Reload XKB data

    sudo dpkg-reconfigure xkb-data
    

I recommend creating new inherited instead of modification which will be overwritten on updates. Check How to add a new keyboard layout (Custom keyboard layout definition) or What are the steps needed to create new keyboard layout on ubuntu?

user.dz
  • 47,137
  • 13
  • 140
  • 258