5

I set up my keyboard layout in /usr/share/X11/xkb/symbols/ to use the keys H J K L as arrows Left, Down, Up and Right as the third and fourth shift level. mostly I followed this post. The Right Alt is my Alternative Characters Key.

While this customization will "basically" work, I can not select text by typing it in conjunction with SHIFT . For example, I can not select the text by pressing Alt Gr+Shift+H, as it would do with Shift+Left. But I can jump a whole word with Ctrl.

the HJKL are working exactly like the arrows in Firefox (with shift and Ctrl) but not on Gedit, Rhythmbox or Chrome, and possibly more...

Any ideas? I'm using Ubuntu 14.04.


Edit:I am using a german keyboard with AltGr. and the files are the fowllowing:

link to keyboard layout

(hope the link works now)

  • Can you post the file you are currently using? I asked something similar here: askubuntu.com/questions/684459/… – rubo77 Oct 12 '15 at 10:39
  • i thought i set those file as public, but... well tried with the link you gave me... (I only have the layout file with me at the moment, which anyway is more relevant for you) - hope it works. – Marcelo Avila Oct 14 '15 at 16:34
  • thanks the link on gist works. but where do I have to change anything now? there are lots of files in /usr/share/X11/xkb/symbols/. I use german layout too, but the symbols file seems weird to me. Maybe you can create a file for us, that we just have to append to the symbols file? – rubo77 Oct 14 '15 at 21:04
2

Go to xkb/types/iso9995 and edit the "THREE_LEVEL" type by adding

  preserve[Shift+LevelThree] = Shift;

so it looks like this

  partial default xkb_types "default" {

// A key type which can be used to implement
// an ISO9995-style level-three shift.

virtual_modifiers LevelThree;

type "THREE_LEVEL" {
    modifiers = Shift+LevelThree;
    map[None] = Level1;
    map[Shift] = Level2;
    map[LevelThree] = Level3;
    map[Shift+LevelThree] = Level3;
    preserve[Shift+LevelThree] = Shift;
    level_name[Level1] = "Base";
    level_name[Level2] = "Shift";
    level_name[Level3] = "Level3";
    };
};

Then go to your symbols file and use this format

    key <AC06>  { type="THREE_LEVEL", [               h,               H,            Left ]     }; 
    key <AC07>  { type="THREE_LEVEL", [               j,               J,            Down ]     }; 
    key <AC08>  { type="THREE_LEVEL", [               k,               K,              Up ]     }; 
    key <AC09>  { type="THREE_LEVEL", [               l,               L,           Right ]     }; 

This is a related question from which I could figure out the answer to yours.

  • Great! it worked. The only thing is that the file is called iso9995. – Marcelo Avila Jul 2 '18 at 23:40
  • Right, my bad. Edited – Damaru Jul 4 '18 at 6:34

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.