MATE keyboard stuck on 'en' layout when applet indicates 'fr' layout

Bill_H

New Member


Messages: 6

#1
On FreeBSD 11 with MATE 1.12.1, I'm trying to get a French keyboard layout to type an email in Thunderbird. The keyboard is a Logitech K120 (English).

I used the Layouts tab of the 'Keyboard Preferences' window (either system-->preferences-->hardware-->keyboard or system-->control center-->keyboard) to add a French (AZERTY) keyboard layout to the list containing the English (US) layout. Boxes for 'separate layout for each window' and 'new windows use active window's layout' are checked. Under Options-->'Switching to another layout' the box for 'Ctrl+Shft' is checked.

The applet in the panel shows the active layout. I can set different windows to different keyboard layouts. As I click on a different window the applet shows the layout that is active for that window.

However, the English keyboard seems to prevail, even if the applet shows an active keyboard layout of French. This was for keyboard input into MATE Terminal, xterm, Firefox, and Thunderbird.

In the Layouts tab of the 'Keyboard Preferences' window there is a box: 'Type to test settings'. I tried it. When the French (AZERTY) layout is highlighted, I would expect to get an 'a' when I type the 'q' key, but just get a 'q'.

Also the 'Ctrl+Shft' keys doesn't have any effect; I have to change layouts by clicking on the applet's language icon.

In case this matters, the machine is a guest VM, running on a host (FreeBSD 11 with MATE 1.12.1 and bhyve). The guest desktop is accessed using TigerVNC running on the host.

I've had some experience with multiple keyboard layouts in Linux, so I thought this would be simple. Does anyone see what I've done wrong?

Thanks.
Bill
 

Sensucht94

Well-Known Member

Thanks: 310
Messages: 335

#2
Bill_H said:
I used the Layouts tab of the 'Keyboard Preferences' window (either system-->preferences-->hardware-->keyboard or system-->control center-->keyboard) to add a French (AZERTY) keyboard layout to the list containing the English (US) layout. Boxes for 'separate layout for each window' and 'new windows use active window's layout' are checked.
Hi, it's true that in MATE, provided you have checked the 'separate layout for each window' option, changing the current active window, switching workplace, and even minimizing the active window or clicking outside of it, will autonomously revert the layout back to the default one, which MATE assumes being the first one on your list in the keyboard-settings' menu. Hence, if you want french to be your default input method, you just have to place it on top of your list, while if you want to prevent MATE from reverting the layout, just disable the 'separate layout...' option

The applet in the panel shows the active layout. I can set different windows to different keyboard layouts. As I click on a different window the applet shows the layout that is active for that window.
Notice that the layout button on the main panel isn't a true MATE 'panel-applet', but a front-end GUI plugin of the settings-daemon (like the volume-set button plugin for the pulseaudio deamon), and will show only in case you added more than one input method (you can't just add it while customizing your panel, through 'Add to Panel' Option).

If your only goal is to be able to quickly insert special characters in MATE, you may just want to add the applet 'Character Palette' to any of you panels.

In the Layouts tab of the 'Keyboard Preferences' window there is a box: 'Type to test settings'. I tried it. When the French (AZERTY) layout is highlighted, I would expect to get an 'a' when I type the 'q' key, but just get a 'q'.

Also the 'Ctrl+Shft' keys doesn't have any effect; I have to change layouts by clicking on the applet's language icon.
Really strange, as for me both the 'type to test settings' and the shortcut to change layout correctly work (I've gone checking the keyboard-settings just know, following you directives). Is the sysutils/mate-settings-daemon loaded at startup in your configuration, and correctly working (any other setting/option lazy)?. Are there any other Input-mangers running (like Cinnamon's textproc/ibus, or the Xfce's deskutils/xfce4-xkb-plugin)? If you recently changed DE, then those process might still be being loaded at startup.

Besides, you could check your Xorg.*.log files in /var/log/ to see if there's any issue. You can as well launch Xorg with startx and get back to CLI with CTRL+ALT+F1, and start the Mate Settings-Control-Center from terminal, so as to look for any error output.

The problem might even be any missing dependency you casually deleted, or any version/option incoherence due to pkgs and ports mixture. Luckly a portmaster -f mate mate-desktop would solve the problem then :).


PS: Another thing, I have also have a US keyboard, but sometimes require some accented letters from the Italian keyboard. In order to be able to switch input method, I rely on the ~/.xinitrc, with setxkbmap() set within, and on file: /usr/local/etc/X11/xorg.conf.d/kbd-layout-multi.conf, then use ALT+Shift or x11/xkb-switch to change current input, without having to depend on MATE. Check the Handbook to learn how to do that: https://www.freebsd.org/doc/handbook/x-config.html [-->5.4.7, 'Input Devices']. A script running setxkbmap all times you launch Thunderbird, may result, for example, another clean way to sort your problem out.
 

Minbari

Active Member

Thanks: 110
Messages: 237

#3
I don't have any switcher on my FreeBSD machine for changing my layout (romanian) just 2 things: a file in /usr/local/etc/X11/xorg.conf.d/kbd-layout-multi.conf which contain the following:

Code:
Section    "InputClass"
    Identifier    "All Keyboards"
    MatchIsKeyboard    "yes"
    Option        "XkbLayout" "us, ro"
EndSection
and the second thing: in .xinitrc I added:
Code:
setxkbmap ro
everytime I'm writing something and need the diacritics I press Alt Gr+the diacritics needed key (eg: Alt Gr+q=â; Alt Gr+a=ă; Alt Gr+i=î, Alt Gr+e=€, Alt Gr+Shift+s=Ș, etc)
 

rufwoof

Active Member

Thanks: 40
Messages: 176

#4
I do similar and as a UK based user I've added

LANG=en_GB.UTF-8; export LANG
CHARSET=UTF-8; export CHARSET
GDM_LANG=en_GB.UTF-8; export GDM_LANG
MM_CHARSET=ISO-8859-1; export MM_CHARSET

to ~/.profile (I use sh) and have

setxkbmap -layout gb

in ~/.xinitrc
 
OP
OP
B

Bill_H

New Member


Messages: 6

#5
Thanks for all your input.

The french keyboard layout was ignored even using setxkbmap, but playing with that command helped. I discovered that the cntl-shift key was interfering with increasing font size in MATE terminals (cntl-shft +) so I switched to alt-shift.

The issue appears to be that the X client (TigerVNC) and X server are on two different machines. On the virtual machine running the X server where the different keyboard layouts were set up with the 'Keyboard Preferences' window:
Code:
$ setxkbmap -print
xkb_keymap {
   xkb_keycodes  { include "xfree86+aliases(qwerty)"   };
   xkb_types     { include "complete"   };
   xkb_compat    { include "complete"   };
   xkb_symbols   { include "pc+us+inet(pc105)+fr(azerty):2+fr:3+group(alt_shift_toggle)"   };
   xkb_geometry  { include "pc(pc105)"   };
};
On the host machine where the X client (TigerVNC) was running:
Code:
$ setxkbmap -print
xkb_keymap {
   xkb_keycodes  { include "xfree86+aliases(qwerty)"   };
   xkb_types     { include "complete"   };
   xkb_compat    { include "complete"   };
   xkb_symbols   { include "pc+us+inet(pc105)"   };
   xkb_geometry  { include "pc(pc105)"   };
};
On the host machine I ran:
Code:
$ setxkbmap -layout 'us,fr(azerty),fr' -option 'grp:alt_shift_toggle'
to make them identical.

Then I tried the alt-shift key and got some French characters. The alt-shift key works on the active window for windows on the host machine. The alt-shift key can change the keyboard layout for the TigerVNC window containing the FreeBSD Desktop without impacting the keyboard layout for other windows.

Unfortunately, the keyboard layout for the TigerVNC window applies to all the windows on the FreeBSD desktop. It would be nice to be able to set different keyboard layouts for different windows on the FreeBSD desktop. Is that possible? I'm guessing the keyboard layout is used on the X client side. Is there anyway to configure xkb to be used on the X server side?

The layout button in the panel (on the server) isn't consistent with the layout in force on the TigerVNC window, nor does clicking on the layout button change the keyboard layout used by TigerVNC window. In retrospect, the keyboard set up on the server machine was an illusion and may have been unnecessary; it may only be required on the client machine.

Thanks again for all your help.

Bill
 
OP
OP
B

Bill_H

New Member


Messages: 6

#7
Have another couple of letters to type in French. Tried again.

Review: FreeBSD with MATE desktop running on a VM. Tiger vncserver running on the VM. FreeBSD with MATE desktop on the VM host. Tiger vncviewer running on the VM host.

Problem: keyboard layout of desktop on the VM over-ridden by keyboard layout of desktop of VM host.

Action: replace vncserver with Xvfb + x11vnc and replace vncviewer with ssvncviewer.

Result: ctrl+shift on VM desktop in cycles through keyboard layouts. keyboard layouts on desktop of VM work as expected and on a per window basis.

Conclusions:
  1. not a problem with MATE,
  2. not a problem with the software for multiple keyboard layouts,
  3. problem with Tiger VNC software.
Caveat: I tried x11vnc because the FAQ had support for key and keyboard issues and there seemed to be many options that might prove useful in solving my problem. It turned out that no special options were needed. However, I only just got this running last night. Xvfb and x11vnc are reporting start up issues that I will be investigating before feeling comfortable with this solution.
 

Snurg

Aspiring Daemon

Thanks: 326
Messages: 794

#8
Maybe you just need the US International keymap.
It's the only one I use.

Here is how I do that:

I have stolen a file xkbmap.usintl by typing setxkbmap -print > xkbmap.usintl, which I put into ~/.config, containing this:

Code:
xkb_keymap {
        xkb_keycodes  { include "xfree86+aliases(qwerty)"       };
        xkb_types     { include "complete"      };
        xkb_compat    { include "complete"      };
        xkb_symbols   { include "pc+us(intl)+group(alt_shift_toggle)"   };
        xkb_geometry  { include "pc(pc104)"     };
};
In .xinitrc I have a line:
Code:
xkbcomp /home/snurg/.config/xkbmap.usintl :0
I like this config, because it is very easy to type in various languages:
Say, French: ç = 'c or AltGr-,
Spanish: Ñ = ~N or AltGr-Shift-N
Scandinavian: Å = AltGr-Shift-W
German: ß = AltGr-s

Two chars mean, first prefix the accent, then type the char to be accented
You can use the following chars as accent prefixes: ` ~ ' " ˙(Alt-Gr-dot) ˇ (Alt-Gr-shift-dot)

When you actually want to type only the prefix chars, just hit space after them.
Some of the prefix keys yield other chars, like " pressed twice yields ¨.

And there are many many nifty other combos, just a few examples:
«» = AltGr-[ and ]
“” = AltGr-shift-[ and ]

Try it out!
The AltGr, shift combos give you a wealth of chars!

Minbari I didn find the Romanian s chars with the thing below them quickly, maybe you'll find the combo for them?
 
Top