5

I am currently working to create a specific greek keyboard layout adapted to French Swiss Keyboard,

I create a keyboard layout to be put to /usr/share/X11/xkb/symbols/( https://github.com/grecromand/grecromand/blob/master/linux/grecromand).

I used code dead_grave. But I would like to create my own dead_xx. It would be dead_sigma which would produce a ς if followed by space or ponctuation mark, and σ otherwise.

I Have understood that dead_key are defined in /usr/share/X11/locale but not more.

I have so many question:

  • WHich file should I modify? Is it possible to create this dead_key without modifiying distributed files, to avoir problem when upgrading my system?
  • How can I declare this dead_key?
Maïeul
  • 161
  • 6
  • 1
    if i understand right, keysym names are defined in libxkbcommon, in `xkbcommon-keysyms.h`. see [`xkb_keysym_t` documentation in xkbcommon](https://xkbcommon.org/doc/current/xkbcommon_8h.html#a79e604a22703391bdfe212cfc10ea007) and [`xkbcommon-keysyms.h`](https://github.com/xkbcommon/libxkbcommon/blob/master/xkbcommon/xkbcommon-keysyms.h#L385). so adding a new arbitrary deadkey looks nontrivial, at least without recompiling, but there's a long list of existing deadkey symbols you might repurpose. – quixotic Nov 26 '17 at 23:35
  • 1
    note the `Compose` files under `/usr/share/X11/locale` are mapping deadkey sequences to output symbols; they do not define the deadkey's own symbol as you'd need to include in a new XKB layout. – quixotic Nov 26 '17 at 23:43
  • 1
    ok. I will try to get an arbitrary dead_key, but I am afraid by some board effect – Maïeul Nov 27 '17 at 09:11
  • I would do like quixotic mentions/recommends and repurpose an existing dead key. There are many dead keys to choose from and you probably don’t need all of them. ☺ – Guildenstern Nov 27 '17 at 18:38

1 Answers1

2

It’s actually surprisingly simple.

In .XCompose, if an entry starts with a character, that character becomes a dead key, regardless of the type of that character. For instance, if you write

<a> <U20>: "a"
<a> <grave>: "à"
<a> <acute>: "á"
<a> <2> <grave>: "ȁ"

every time you type “a” the system will wait for the next character. Note that if the next character isn’t supported, nothing will be typed. So, in this case, “a06” will return just “6”.

If you don’t want to use a standard character, you can use one of the characters in the private use area, like  (U+E700).

So, in your case, all you need to do is to write the following in the $HOME/.XCompose file.

<U3C3> <U20>: "ς "
<U3C3> <U21>: "ς!"
<U3C3> <U2C>: "ς,"
<U3C3> <U2E>: "ς."
<U3C3> <U3A>: "ς:"
<U3C3> <U3B>: "ς;"
<U3C3> <U3F>: "ς?"

<U3C3> <U3B1>: "σα"
<U3C3> <U3B2>: "σβ"
<U3C3> <U3B3>: "σγ"
<U3C3> <U3B4>: "σδ"
<U3C3> <U3B5>: "σε"
<U3C3> <U3B6>: "σζ"
<U3C3> <U3B7>: "ση"
<U3C3> <U3B8>: "σθ"
<U3C3> <U3B9>: "σι"
<U3C3> <U3BA>: "σκ"
<U3C3> <U3BB>: "σλ"
<U3C3> <U3BC>: "σμ"
<U3C3> <U3BD>: "σν"
<U3C3> <U3BE>: "σξ"
<U3C3> <U3BF>: "σο"
<U3C3> <U3C0>: "σπ"
<U3C3> <U3C1>: "σρ"
<U3C3> <U3C3>: "σσ"
<U3C3> <U3C4>: "στ"
<U3C3> <U3C5>: "συ"
<U3C3> <U3C6>: "σφ"
<U3C3> <U3C7>: "σχ"
<U3C3> <U3C8>: "σψ"
<U3C3> <U3C9>: "σω"
<U3C3> <dead_acute> <U3B1>: "σά"
<U3C3> <dead_acute> <U3B5>: "σέ"
<U3C3> <dead_acute> <U3B7>: "σή"
<U3C3> <dead_acute> <U3B9>: "σί"
<U3C3> <dead_acute> <U3BF>: "σό"
<U3C3> <dead_acute> <U3C5>: "σύ"
<U3C3> <dead_acute> <U3C9>: "σώ"
<U3C3> <dead_diaeresis> <U3B9>: "σϊ"
<U3C3> <dead_diaeresis> <U3C5>: "σϋ"

You may also need a combination to type σ alone.

Lo Un
  • 21
  • 3