3

This question already has an answer here:

I've used Linux and FreeBSD as my main desktop environments from 2000 to 2006. Back then we would have to edit keyboard maps to make Portuguese Brazilian work. Since then, I stopped using Linux as desktop and moved to MacOS because it was very time consuming to just get things done.

I've been hearing about all the evolution of the Linux desktop in the last decade and a couple of weeks ago I just bought a new Dell XPS preloaded with Ubuntu 16.04 and what a surprise... I just can't get my keyboard to work correctly!

At first I couldn't get it to write the cedilla "ç" using US-international. By following the instructions in How to type latin small letter c with cedilla I could get it to work, but now all consonants get "accented" (.e.g., '+s becomes ś or '+r becomes ŕ), which is just not possible in Portuguese. The expected behavior would be 's or 'r.

Why is it so difficult to just get things right?

I would like to know if is there any solution or workaround to this problem.

EDIT: Someone marked this as duplicate of another question on how to use multiple languages. This is not the issue here. My question is how to make Ubuntu/Linux correctly work to write Brazilian Portuguese using a US keyboard.

In other words, typing ' followed by s should output 's and not ś, meanwhile typing ' followed by a should output á and typing ' followed by c should output ç.

So, the question is how do I get this behavior?

EDIT: As I got no real answer I coded a small ibus input method, based on ibus-tmpl for solving this. Probably not a good solution, but the quickest workaround I could find. It is available on http://github.com/gcms/ibus-semidead

marked as duplicate by pomsky, user68186, karel, user364819, user535733 Feb 21 '18 at 0:08

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Why don't you use a Portugese keyboard layout? – wjandrea Feb 20 '18 at 17:29
  • I speak French myself. If I'm going to be writing just a few words, I'll use the US layout with Compose key for accented characters, but if I'll be writing paragraphs, I'll switch to the Canadian French layout. – wjandrea Feb 20 '18 at 17:32
  • "typing ' followed by s should output 's and not ś,...": read the answer I linked carefully. You need to press <space> after the apostrophe key (') in order use in as apostrophe instead of accent. So ' + s = ś, ' + space + s = 's. Also right alt + , = ç (take a look at the keyboad layout). – pomsky Feb 20 '18 at 17:36
  • 3
    It sounds like English (US, international with dead keys) is not what you want. Did you understand @wjandrea's hint about a compose key? That would give you most accented characters, but not ccedilla. To handle the latter a custom keyboard layout is one possibility. – Gunnar Hjalmarsson Feb 20 '18 at 18:14
  • 2
    My last comment here as I feel nothing fruitful is going to come out of this discussion any more: if "the desired behavior" is replicating some feature from another OS in Ubuntu, then it may not always be possible (same goes the other way around). (I'm not claiming it's impossible in this particular issue) – pomsky Feb 20 '18 at 18:16
3

When you use the English (US, international with dead keys) layout, the ' (apostrophe) key is turned to a 'dead' key. To type an accent character by itself, you can press ' twice, which results in ´ (acute accent), or you can press ' followed by Space, which results in ' (apostrophe).

Edit:

If you prefer the basic English (US) layout without dead keys, the below may be a suitable setup for GTK applications:

  1. Enable a compose key: How can I enable Compose key?

  2. Create the file ~/.XCompose and give it this contents:

    <Multi_key> <apostrophe> <C> : "Ç" Ccedilla # LATIN CAPITAL LETTER C WITH CEDILLA
    <Multi_key> <apostrophe> <c> : "ç" ccedilla # LATIN SMALL LETTER C WITH CEDILLA
    

Then you can easily type the most common accented letters, for instance:

Compose followed by ' followed by A => á

Compose followed by ' followed by C => ç

and at the same time:

' followed by S => 's

Edit II:

As David pointed out in a comment, the compose key has a built-in way to type ccedilla:

Compose followed by , (comma) followed by C => ç

So basically the ~/.XCompose file suggested above is redundant.

  • I know this, but this is not the desired behavior nor natural for Portuguese writers. Thatś why I am asking for a solution that works correctly. Why is it that it works smoothly in Windows and MacOS but not in Linux? There must be a solution to this problem. – Gustavo Sousa Feb 20 '18 at 16:17
  • 2
    The default US keyboard layout already allows the cedilla (ç, Ç) through the compose sequence , (comma), c and ,, Shift+c. – David Foerster Feb 24 '18 at 11:19
  • @DavidFoerster: You are right. I kind of forgot that in my attempt to come as close to the OP's specification as possible. But indeed, that way makes probably the ~/XCompose file redundant. – Gunnar Hjalmarsson Feb 24 '18 at 15:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.