2

I have Ubuntu 19.04 and I'm using the English US International keyboard layout because I want to use accented letters like á, ö, ã, etc. Everything works well, but maybe a little too well.

When I type ' + a, I get the character á, which is the expected behaviour. But when I type ' + s or ' + m then I get ś and ḿ respectively and I don't want these characters.

If I type ' + s then I expect the layout to output 's instead of ś, or if I type ' + m then I expect the layout to output 'm instead of ḿ.

Before somebody says that I'm asking for something crazy because I want the keyboard layout to selectively put accents in some letters, but ignores the accent on other letters, I also use US International keyboard layout on macOS and on Windows computers and they both behave in the way that I expect: ' + a outputs á but ' + s outputs 's instead of ś.

Is it possible to have the same behaviour on Linux?

vegidio
  • 121
  • 1
    I haven't tried, but this may help: https://help.ubuntu.com/community/Custom%20keyboard%20layout%20definitions – FedKad Aug 18 '19 at 08:17
  • Is it possible to create custom shortcuts for the characters that you need: https://askubuntu.com/a/1098122/566421 – pa4080 Aug 18 '19 at 19:59
  • I have noticed that Ubuntu 22.04 partially implements what you want, although with a seemingly random choice of which letters are accentuated and which ones are not. For example, '+t gives you 't. All of the letters usually accentuated in most Latin languages get their accents alright, but some other ones do too, such as ŕ. It would be great to have access to the system table determining this behavior but so far I have no idea where does it lie. – Ruy May 10 '23 at 13:35

1 Answers1

2

I'm not aware of a way on Linux to achieve the exact behavior you describe. At least it cannot be done only via XKB.

I would suggest that you try another keyboard layout. Assuming that you only need to type accented characters occasionally, check out the English (intl., with AltGr dead keys) keyboard layout. It only triggers the dead key behavior together with the Right Alt modifier.

' followed by a => 'a

Right Alt+' followed by a => á

Gunnar Hjalmarsson
  • 33,540
  • 3
  • 64
  • 94