*

Offline xasop

  • Administrator
  • *****
  • Posts: 6646
  • Professional computer somebody
    • View Profile
Custom keyboard layouts in X11
« on: April 03, 2021, 12:53:52 AM »
As a student of the Irish language, I wanted a way to enter a sineadh fada without using the XCompose method that has served me so well up to this point. The reasons are efficiency and accuracy: XCompose requires three keystrokes to input é, as opposed to two for a keyboard layout with AltGr+e; and this has the knock-on effect of making mistakes commonplace, such as pressing the keys in the wrong order and getting *iománáiocht instead of iománaíocht.

Unfortunately, the standard Irish keyboard layout is based on the terminally crippled UK layout, which means that it has (among other things) @, ", #, ~ and a few other symbols in the wrong places. Therefore, I took it upon myself to learn how to write my own xkb symbols file to create an ANSI-based Irish keyboard layout.

This turned out to be quite straightforward. The main annoyance is that if you make a mistake, X gives you no information whatsoever except that your symbols file has a mistake somewhere in it. But with a little trial and error, it's easy to get something that works well.

And so, behold! My new keyboard layout. I simply inherited the us(basic) layout I was already using (I don't want any of my existing usage to change), and added some new characters as combinations with AltGr. Each key has four symbols associated with it, corresponding to the key on its own, with Shift, with AltGr and with AltGr+Shift, respectively. NoSymbol means not to change the existing behaviour, which is why I used it everywhere that AltGr is not involved.

Code: [Select]
xkb_symbols "basic" {
    include "us(basic)"

    name[Group1]= "Irish (ANSI)";

    // Euro on 5 key
    key <AE05> { [ NoSymbol, NoSymbol,  EuroSign,       cent ] };

    // Q row
    key <AD03> { [ NoSymbol, NoSymbol,    eacute,     Eacute ] };
    key <AD04> { [ NoSymbol, NoSymbol, 0x100027C,   NoSymbol ] };
                                       // long r
    key <AD05> { [ NoSymbol, NoSymbol, tabovedot,  Tabovedot ] };
    key <AD07> { [ NoSymbol, NoSymbol,    uacute,     Uacute ] };
    key <AD08> { [ NoSymbol, NoSymbol,    iacute,     Iacute ] };
    key <AD09> { [ NoSymbol, NoSymbol,    oacute,     Oacute ] };
    key <AD10> { [ NoSymbol, NoSymbol, pabovedot,  Pabovedot ] };

    // A row
    key <AC01> { [ NoSymbol, NoSymbol,    aacute,     Aacute ] };
    key <AC02> { [ NoSymbol, NoSymbol, sabovedot,  Sabovedot ] };
    key <AC03> { [ NoSymbol, NoSymbol, dabovedot,  Dabovedot ] };
    key <AC04> { [ NoSymbol, NoSymbol, fabovedot,  Fabovedot ] };
    key <AC05> { [ NoSymbol, NoSymbol, gabovedot,  Gabovedot ] };

    // Z row
    key <AB01> { [ NoSymbol, NoSymbol, 0x100017F,  0x1001E9B ] };
                                       // long s, long s dot
    key <AB03> { [ NoSymbol, NoSymbol, cabovedot,  Cabovedot ] };
    key <AB05> { [ NoSymbol, NoSymbol, babovedot,  Babovedot ] };
    key <AB07> { [ NoSymbol, NoSymbol, mabovedot,  Mabovedot ] };

    include "level3(ralt_switch)"
};
« Last Edit: April 03, 2021, 01:26:35 AM by la xasop »
when you try to mock anyone while also running the flat earth society. Lol

*

Offline Toddler Thork

  • *
  • Posts: 3591
  • https://onlyfans.com/thork
    • View Profile
Re: Custom keyboard layouts in X11
« Reply #1 on: April 03, 2021, 08:59:51 AM »
Use a text expandor and it will auto correct to add all the silly accents for you. Also, 100% of Irish people speak English. Most don't speak Irish very well. You are wasting your life. You could be learning Japanese or Korean or something instead.
Rate this post.      👍 6     👎 1

*

Offline xasop

  • Administrator
  • *****
  • Posts: 6646
  • Professional computer somebody
    • View Profile
Re: Custom keyboard layouts in X11
« Reply #2 on: April 03, 2021, 10:16:36 AM »
Use a text expandor and it will auto correct to add all the silly accents for you.

No.

Also, 100% of Irish people speak English. Most don't speak Irish very well. You are wasting your life. You could be learning Japanese or Korean or something instead.

Coming from an Englishman, this is particularly rich.
when you try to mock anyone while also running the flat earth society. Lol

*

Offline Rama Set

  • *
  • Posts: 7673
  • Round and round...
    • View Profile
Re: Custom keyboard layouts in X11
« Reply #3 on: April 03, 2021, 10:19:43 AM »
Use a text expandor and it will auto correct to add all the silly accents for you.

No.

Also, 100% of Irish people speak English. Most don't speak Irish very well. You are wasting your life. You could be learning Japanese or Korean or something instead.

Coming from an Englishman, this is particularly rich.

Thork set a president for this kind of thing.
Th*rk is the worst person on this website.

*

Offline xasop

  • Administrator
  • *****
  • Posts: 6646
  • Professional computer somebody
    • View Profile
Re: Custom keyboard layouts in X11
« Reply #4 on: April 04, 2021, 10:09:04 PM »
I made a futhorc keyboard layout! This one does not inherit from any existing layout since its only purpose is to type Old English using runes, which didn't tend to use punctuation, although I did include numbers because they seem kind of useful. The layout is based on phonetic correspondence (or similarity) to QWERTY, but I relegated the pseudo-runes, īor, cweorð and stan, to the punctuation keys to the right where they can go mostly untouched. Cealc, being just a variant of calc which is not really necessary, is typed as Shift+calc.

With this layout, I can now say that ᚦᚩᚱᛣ ᛁᛋ ᚪᛏᚩᛚ.

Code: [Select]
xkb_symbols "basic" {
    name[Group1]= "Old English (Futhorc)";

    key <AE01> { [ 1 ] };
    key <AE02> { [ 2 ] };
    key <AE03> { [ 3 ] };
    key <AE04> { [ 4 ] };
    key <AE05> { [ 5 ] };
    key <AE06> { [ 6 ] };
    key <AE07> { [ 7 ] };
    key <AE08> { [ 8 ] };
    key <AE09> { [ 9 ] };
    key <AE10> { [ 0 ] };

    key <AD01> { [ U16C7 ] }; // eoh
    key <AD02> { [ U16B9 ] }; // wynn
    key <AD03> { [ U16D6 ] }; // ehwaz
    key <AD04> { [ U16B1 ] }; // rad
    key <AD05> { [ U16CF ] }; // tiwaz
    key <AD06> { [ U16A3 ] }; // yr
    key <AD07> { [ U16A2 ] }; // ur
    key <AD08> { [ U16C1 ] }; // is
    key <AD09> { [ U16A9 ] }; // os
    key <AD10> { [ U16C8 ] }; // peorth
    key <AD11> { [ U16E2 ] }; // cweorth
    key <AD12> { [ U16E5 ] }; // stan

    key <AC01> { [ U16AA ] }; // ac
    key <AC02> { [ U16CB ] }; // sigel
    key <AC03> { [ U16DE ] }; // daeg
    key <AC04> { [ U16A0 ] }; // feoh
    key <AC05> { [ U16B7 ] }; // gyfu
    key <AC06> { [ U16BB ] }; // haegl
    key <AC07> { [ U16C4 ] }; // ger
    key <AC08> { [ U16DF ] }; // ethel
    key <AC09> { [ U16DA ] }; // lagu
    key <AC10> { [ U16E0 ] }; // ear
    key <AC11> { [ U16E1 ] }; // ior

    key <AB01> { [ U16AB ] }; // aesc
    key <AB02> { [ U16C9 ] }; // eolhx
    key <AB03> { [ U16B3 ] }; // cen
    key <AB04> { [ U16A6 ] }; // thorn
    key <AB05> { [ U16D2 ] }; // beorc
    key <AB06> { [ U16BE ] }; // nyd
    key <AB07> { [ U16D7 ] }; // mann
    key <AB08> { [ U16DD ] }; // Ing
    key <AB09> { [ U16E3, U16E4 ] }; // calc, cealc
    key <AB10> { [ U16B8 ] }; // gar
};
« Last Edit: April 04, 2021, 10:41:00 PM by la xasop »
when you try to mock anyone while also running the flat earth society. Lol