Getting French Characters On Your English Keyboard With Gnome

Those familiar with Windows (and I guess Mac OSX too) will probably be aware that you can get an é character from your keyboard by pressing AltGr + E. You may not be aware that in Linux you can't. This was a bit of a problem for me, as I live in France, a country who's native language relies rather heavily on the accents in the special character set. For example, the town I'm in is called Uzès and my daughter is called Moïra. It's also been driving my wife bananas, since she actually needs to write emails and letters in French but we have British keyboard layouts.

For the last year this little issue has been ignored, largely because I could not figure out for the life of me how to make Linux do special characters (easily, at least - the character map is no solution). In spite of infrequent, but dogged attempts to Google a solution, I found the problem is people usually loosely describe a solution with the assumption of a degree of knowledge I lack about Gnome, the Linux desktop solution I use.

Well, I finally worked out the easiest path to victory, thanks in no small part to this excellent blog post on the matter. The author there notes there are several ways to get Linux to do special characters. The simplest being to hold down Ctrl + Shift and type the UTF hexadecimal code for the character you're after. This does work right out of the box, but this, like character map, isn't really a solution - asking my wife to memorise half a dozen hexadecimal numbers was not going to be greeted with enthusiasm.

The thing this blogger notes, which I hadn't heard of before and was the significant missing piece when it came to cracking the issue, was the Linux concept of a "third level" and "fourth level" keyboard. (Keyboards of special characters accessed by pressing the AltGr key or AltGr + Shift.) This, I realised, was the Windows feature I was missing! It's actually there all along, but for some reason it is off by default in Gnome. Crazy!

So, STEP ONE: To enable it (in Fedora 10, but steps will be similar in all Gnome desktops, though menu items may be slightly differently labelled or ordered) go to System -> Preferences -> Hardware -> Keyboard. Click on the Layouts tab and click on Layout Options (it's a button there). Expand the "Third level choosers" option set and tick "Press Right Alt key to choose 3rd level". Close, and you're done. The Linux keyboard will now behave like the Windows keyboard (special characters with AltGr pressed).

However, it seems the "international" layouts containing the special characters are, again, there but not enabled by default. Again, crazy! Why this is I do not know, as they are default in Windows so it's fair to assume people expect them and it seems a silly feature to make people jump through hoops for when it should just be there by default. But anyway, there is no Linux keyboard layout for United Kingdom international, sadly (I might look in to making my own). There is a USA International keyboard layout though, which has accents where you'd expect if you're used to Windows. To add it:

On to STEP TWO: Go back to System -> Preferences -> Hardware -> Keyboard and click Layouts again. Click the Add button (dur). Pick Country of United States and pick from Variants "USA International (AltGr dead keys)". Close and you now have two layouts enabled. However, if you're British you probably still want a UK layout most of the time, so set your UK layout as default.

The final trick is to know which layout is currently active and see what the third and fourth level options are for that layout. This messed me up too - I couldn't figure out how to actually get at the Gnome Keyboard Indicator. Most people on the Internet assume that telling someone to "Add a Panel" in Gnome tells them everything they need to know about how to switch on the Keyboard Indicator, but since numb-nuts here didn't know what "Add a Panel" meant, finding a tutorial that actually *showed* you how to do it was not so easy. Eventually I did:
http://www.my-guides.net/en/content/view/161/26/1/4/

STEP THREE: Using the very last step from that link I got my layout selector up in the top bar of my desktop. Just click it to switch layout from UK to USA International. And this is the really cool bit: right-click it and select "Show Current Layout" brings up a preview of the keyboard, showing you where all the special characters are hiding. Marvellous!

The slight pain is having to flick to the USA layout to get the international characters (@ and " switch places, etc.) but it's not too bad, and I suspect it's easily remedied if I can be bothered to find (or make) a UK international layout.

One thing to note. If, like us, you want to write in French then the USA International layout is still not hugely useful. It has no grave accents, for some weird reason. Now you know how to add, switch and view layouts, I suggest trying some other layouts which have the special characters you need more readily accessible.

Canada Multilingual or Switzerland French both look to be good options for French writers. They are QWERTY layouts but with the é, á, etc. mapped to first and second level keys for convenience. Since you have to switch layouts anyway, you might as well switch to a layout natively intended to support your target language on a QWERTY keyboard. We're going to road test Canada Multilingual.

great

Thx a lot I had problème with â and ë ...
Cheers

Today...

Today... you're my hero. This helped me work out a solution on Arch Linux for switching between:

"USA with € on 5" - The layout I use most; for typing English
"USA Intl with dead keys" - For typing Dutch, my native language, without using alt, just like on Windows
"Swedish" - The language of the country I live in now

So thanks, bedankt and tack så mycket!

accented characters in Gnome

In keyboard layout options, rather than choosing a different level, select 'Compose key position'. Select a suitable Compose key (I use the right hand 'win' key). Press this key the ' then e and you get an accented é, similarly for other accented characters.

But

Thanks, but that is only the accent *one way*. As far as I can tell, there's no way to get an e with a grave accent (è), for example, with the Compose key.

And what about î or maybe ï? Or à? Etc.

Compose key gives you *some* options, but unless I'm mistaken they're fairly limited.

Actually, on a Mac there is a

Actually, on a Mac there is a very easy to remember system of first typing the combination for the accent, then the key. So option-e is acute accent, then type the e itself. The combination key is usually the letter that most commonly has that accent, on in some cases a mnemonic: e acute, i circumflex, u umlaut/trema, a grave, a few things to remember, but not to much of a burden on the memory and you see what the accent is as soon as you type it anyway so if you get it wrong (I forget which i and u do for example) you just backspace.

I seem to remember from my attempts at liking Linux desktops that there is the same sort of thing on GNOME, just that it takes a while to find it.

Have fun in there!

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.