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
  • 19,395
  • 55
  • 76
  • 81

4 Answers4

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 é

Sadaharu Wakisaka
  • 1,329
  • 1
  • 13
  • 25
  • thanks for your comment. I learn french and normally write 200+ sentences every day. Unfortunately xbindkeys didn't work for me. I then just re-assigned keys on my own preference in ` /usr/share/X11/xkb/symbols/us ` under the section ` include "us(basic)" name[Group1]= "English (US, intl., with dead keys)";` inspired by https://askubuntu.com/questions/1187917/change-accented-letters-in-international-with-dead-keys-keyboard-layout – Dmitriy Ashmarin Aug 14 '20 at 11:28
  • It will do, too. AZERTY is also nice. – Sadaharu Wakisaka Aug 14 '20 at 21:50
1

If you use a standard US keyboard, the easiest way obviously would be to use the US International layout, even if currently, it does not look convenient to you. It provides the most simple approach, using dead keys, to provide accented letters such as ê, é, è. Alt_right, provides you a ç.

If you do not want the dead keys at times when you do not type French, then you can still set up US International next to your regular keyboard layout, and switch to the US international layout when desired.

Alternatively, the classical Linux way of entering accented letters is by enabling a Compose key. The compose key allows a wide variety of characters to be entered. It works with your regular keyboard layout. Assuming you use the standard desktop of Ubuntu 20.04, you can set up a compose key in Gnome Tweaks (not installed by default!) on the "Keyboard & Mouse" tab. To use it, press the compose key and then a sequence of characters. If you defined for example left Alt as the compose key, you would enter ç as left_Altc,.

vanadium
  • 82,909
  • 6
  • 116
  • 186
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
  • 312
  • 1
  • 5
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
  • 165
  • 4