4

I recently installed Ubuntu 20.4 and looking a way to write French accents. On Windows I used TypeIt app which provides a fast way to write different accents of the same letter. The idea is to press AltGr+a key, each time you press the same key while holding AltGr it will type that key with different accents.

For example, I press AltGr+e once - it types é, I keep holding AltGr and press e second time - it types è, third time - ê.

I was looking on the Internet how to change keys mapping but didn't find a way of assigning multiple different letters based on how many times I pressed a key.

I am aware of US intern. + dead keys, but this way doesn't look convenient for me.

Kevin Bowen
  • 20,055
  • 57
  • 82
  • 84

4 Answers4

4

If you use a standard US keyboard, the easiest way would be to use the US International layout. It provides the most simple approach, using three "dead keys" (^, ', and `) to provide accented letters such as ê, é, è. Type the dead key corresponding to the accent mark you want, and then the corresponding vowel. Typing a dead key and then space, or another character to which the accent does not relate, gives the dead key's original value (plus the other key's character, if it was not space). Alt_right+, (as a chord not a sequence) provides you a ç.

To add US International as an active keyboard layout in Ubuntu 24.04, go to Keyboards in settings, choose "English (United States)" which gives a sub-list of US English Keyboards that includes "English (US, intl., with dead keys)". Detailed instructions with screenshots here. You can easily switch back to your regular keyboard layout. The default shortcut to switch between keyboards is super+space.

Alternatively, one can enable a Compose key. The compose key allows a wide variety of characters to be entered. It works with your regular keyboard layout. In Ubuntu 24.04, the compose key is set in Keyboard settings, under "Special Character Entry". To use it, press the compose key and then a sequence of characters. For accents these are the same "dead keys" but in reverse order from US International: letter first, then accent. If you defined for example left Alt as the compose key, you for é you would type left_Alte'. And ç is left_Altc,.

vanadium
  • 97,564
1

There are some handy packages to manipulate each key and mouse button.
For the packagesxmodmap xbindkeys xdotool and xte are popular.

sudo apt install x11-xserver-utils
sudo apt install xbindkeys

Edit ~/.xbindkeysrc add lines below. (if there's no such file xbindkeys --defaults > $HOME/.xbindkeysrc to create one.

"xdotool key U00e9"
 AltGr+e+release

"xdotool key U00e8" AltGr+w+e+release

Save this file and
pkill -f xbindkeys && xbindkeys
execute this command to apply changes.

Now then, AltGr+e should type é and AltGr+w+e type è.
But I am afraid that I haven't tested this. I am not sure this works or not.


I love using Compose key and its combinations.
How to get letter "ć" with the dead keys?
It depends how often you need an accent letter, if it's only once in a week then I recommend Control+Shift+U and type a hexdecimal number (00e9) then Space, you get é

0

And if you do not like to have dead keys in the International layout, please consider the US International with AltGr dead keys layout. AltGr+e will produce é, but a single ' will NOT be dead and produce a '. AltGr+', however, will be dead. AltGr+" is also dead, giving you access to ë. The whole story is here.

Adriaan
  • 332
0

********* This does not work fully ************** I found using iBus handy (and I did this on Xubuntu 22.04 using a regular English-US keyboard). No need to change system keyboard configuration (I tried fooling around with it initially but had no success, so just kept it with English-US). Just install iBus. Then in iBus->Perferences->Input Method, add "French - English (intl., with AltGr dead keys)". Then when typing French, click on the iBus icon on the panel and select the above method. Then the combinations with the right-alt key will produce the accented letters. The input method also allows to continue typing English text without special operations.

BTW, I did similarly with German by adding "German - English (intl., with AltGr dead keys)".


Update: The above only gets accented letters, but not graves and so forth. I had to change the approach, as documented https://xilinjia.github.io/2022/11/12/type-french-german.html

Basically, setting a Compose key via keyboard setting helps.

LXJ
  • 194