Difference between revisions of "International keyboard settings"

From Organic Design wiki
m
m (Mexican keyboard issues)
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
<onlyinclude>To make your keyboard have the accents working for Brazilian Portuguese on [[Debian]]-like operating systems in the proper way that Brazilians are used to, you need to add a second ''Keyboard Layout'' which uses the '''English (US, alternative international)''' language. In some operating systems such as Ubuntu 12 or later, that's all you need to do, but folder others a hack is required to fix the cedilla.</onlyinclude>
+
<onlyinclude>To make your keyboard have the accents working for Brazilian Portuguese on [[Debian]]-like operating systems in the proper way that Brazilians are used to, you need to add a second ''Keyboard Layout'' which uses the '''English (US, alternative international)''' language.  
  
== Debian & Pre Ubuntu 12 ==
+
The dead keys are single quote, double quote, back-tick and tilde, typing any of these characters while using the international keyboard will result in an accent being applied to the next typed character - unless the next character is a space in which case the dead-key itself will be typed. For example single quote, double quote, back-tick and tilde respectively followed by the letter '''A''' results in '''á''', '''ä''', '''à''' and '''ã'''.
On versions of [[Ubuntu]] before 12, a hack is required to get the cedilla working. Apostrophe then "C" makes a "<big>ć</big>", which doesn't even exist in Portuguese! It should give the [[w:Ç|c-cedilla]] (<big>ç</big>). To fix this final problem you need to edit the '''gtk.immodules''' (this is in different locations on different distros and versions, sometimes it's in ''/usr/lib/gtk-2.0/2.10.0/'', but if not just ''find'' or ''locate'' it) configuration file with root privileges. Here's where I found it on my [[Debian]] 7 installation:
+
 
<source>
+
In Spanish, upside down question marks ('''¿''') and exclamation marks ('''¡''') are also required as they work like quotes that wrap around a sentence in Spanish. These characters are available on the international keyboard using '''right-alt + 1''' and '''right-alt + /'''.
sudo nano /usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/gtk.immodules
 
</source>
 
  
 +
== Mexican keyboard issues ==
 +
We got a laptop from Mexico and it has a really strange keyboard, but worse still was that many of the keys didn't work in Linux, for example "@" is on the bottom-right of the "Q" key implying that <tt>Alt-Gr + Q</tt> should produce the "@" symbol, but it did not. Doing <tt>setxkbmap -query</tt> showed that it was set to <tt>latam.bz.us.us</tt> which is really messed up - it needs to just be <tt>latam</tt>.
  
Then find the line that configures the cedilla and add an "en" option keeping the items in alphabetical order so it looks like this:
+
To make matters more difficult, we need '''es''', '''pt''' and '''en-intl''' keyboard layouts on the machine with the new <tt>latam</tt> setting applying only to the '''es''' layout, and furthermore the machine is used sometimes in ''Xorg'' and sometimes in ''Wayland''!
<source>"cedilla" "Cedilla" "gtk20" "/usr/share/locale" "az:ca:co:en:fr:gv:oc:pt:sq:tr:wa"</source>
 
  
 +
In the end it was fixed by adding the following line to the end of  <tt>~/.profile</tt>.
 +
<source>
 +
setxkbmap -layout "latam,pt,us" -variant ",,intl"
 +
</source>
  
A restart will be required before the change takes effect, and your cedilla's should be working properly :-)
+
== Cedilla ==
 +
An annoying hack is required to fix the cedilla, because the apostrophe+C yields a C with an accent instead of a Cedilla!</onlyinclude>. But note that if the hack is not installed, or it doesn't work on your distro, the cedilla is also available using '''right-alt + comma'''.
  
== Linux Mint ==
+
I had included some solutions for various Debian-based OS's here, but they were sub-optimal because they were always failing edge cases. But fortunately I recently found this cool [https://github.com/marcopaganini/gnome-cedilla-fix fix-cedilla] script by [http://www.paganini.net/ Marco Paganini] that seems to work across most versions and flavours of Linux and in most programs whether they're shell, Gnome, Cinnamon, QT or whatever! Thanks Marco :-)
On '''Linux Mint''' this solution doesn't work because that file doesn't exist, but searching for the word "cedilla" in all files yields the same line in two files which in my case are called '''/usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules.cache''' and '''/usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules.cache''' (just search for '''immodules.cache''' to find them on your system) and making the change in both of those seems to fix the problem. The only worry is that the file ends in ''.cache'' which kind if implies that it could get rebuilt at some point and remove your changes, but it's been working for me so far, and if it does get overwritten I'll add a script to fix it on reboot or something.
 
  
To change the flag icon in the keyboard panel applet, do the modifications in the '''/usr/share/cinnamon/applets/keyboard@cinnamon.org/flags''' directory.
+
'''Note:''' This script stops dead keys from working in Telegram, but this can be fixed by commenting out the line that says '''QT_IM_MODULE=cedilla''' in the ''/etc/environment'' file.
  
 
== See also ==
 
== See also ==
 +
*[https://code.organicdesign.co.nz/tools/blob/master/fix-cedilla.sh Local copy of Marco's script]
 
*[[Apple wireless keyboard on Linux]]
 
*[[Apple wireless keyboard on Linux]]
 
[[Category:Help]][[Category:Linux]]
 
[[Category:Help]][[Category:Linux]]

Latest revision as of 16:49, 8 March 2025

To make your keyboard have the accents working for Brazilian Portuguese on Debian-like operating systems in the proper way that Brazilians are used to, you need to add a second Keyboard Layout which uses the English (US, alternative international) language.

The dead keys are single quote, double quote, back-tick and tilde, typing any of these characters while using the international keyboard will result in an accent being applied to the next typed character - unless the next character is a space in which case the dead-key itself will be typed. For example single quote, double quote, back-tick and tilde respectively followed by the letter A results in á, ä, à and ã.

In Spanish, upside down question marks (¿) and exclamation marks (¡) are also required as they work like quotes that wrap around a sentence in Spanish. These characters are available on the international keyboard using right-alt + 1 and right-alt + /.

Mexican keyboard issues

We got a laptop from Mexico and it has a really strange keyboard, but worse still was that many of the keys didn't work in Linux, for example "@" is on the bottom-right of the "Q" key implying that Alt-Gr + Q should produce the "@" symbol, but it did not. Doing setxkbmap -query showed that it was set to latam.bz.us.us which is really messed up - it needs to just be latam.

To make matters more difficult, we need es, pt and en-intl keyboard layouts on the machine with the new latam setting applying only to the es layout, and furthermore the machine is used sometimes in Xorg and sometimes in Wayland!

In the end it was fixed by adding the following line to the end of ~/.profile.

setxkbmap -layout "latam,pt,us" -variant ",,intl"

Cedilla

An annoying hack is required to fix the cedilla, because the apostrophe+C yields a C with an accent instead of a Cedilla!. But note that if the hack is not installed, or it doesn't work on your distro, the cedilla is also available using right-alt + comma.

I had included some solutions for various Debian-based OS's here, but they were sub-optimal because they were always failing edge cases. But fortunately I recently found this cool fix-cedilla script by Marco Paganini that seems to work across most versions and flavours of Linux and in most programs whether they're shell, Gnome, Cinnamon, QT or whatever! Thanks Marco :-)

Note: This script stops dead keys from working in Telegram, but this can be fixed by commenting out the line that says QT_IM_MODULE=cedilla in the /etc/environment file.

See also