You are not logged in.

#1 2017-09-07 19:11:22

sync0
Member
From: Paris
Registered: 2017-09-07
Posts: 7

[SOLVED] Unable to switch between keyboard input methods using xorg

Dear Arch Community, 

I switched to Arch about three months ago, and I am still tweeking things around my system. Unfortunately, I haven't figured out (by reading the wiki, forums, man pages, etc.) how to change the keyboard input methods by pressing (left) ALT + Space bar. This feature is very important because I frequently use at least three different layouts (US English, Spanish, and Korean).

Currently, my machine is a Thinkpad X230 with XFCE 4, and I have it set to use system keyboard defaults (btw, I tried not using system defaults to set things through XFCE directly, but that didn't work either). The contents of my "/etc/X11/xorg.conf.d/00-keyboard.conf" file are as follows:

Section "InputClass"
	Identifier "system-keyboard"
	MatchIsKeyboard "on"
        Driver "evdev"
	Option "XkbRules" "xorg"
	Option "XkbModel" "pc105"
	Option "XkbLayout" "us,es,kr"
	Option "XkbVariant" "altgr-intl,deadtilde," 
	Option "XkbOptions" "altwin:super_win,grp:alt_space_toggle,compose:ralt"
EndSection

The added lines to my ".Xmodmap" file are:

clear lock
clear control
add control = Caps_Lock Control_L Control_R
keycode 66 = Control_L Caps_Lock NoSymbol NoSymbol

And, finally, the contents of my ".xinitrc" file are:

#!/bin/sh
# start some nice programs
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
  [ -x "$f" ] && . "$f"
 done
 unset f
fi

eval $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh)
export SSH_AUTH_SOCK

[[ -f ~/.Xmodmap ]] && xmodmap ~/.Xmodmap

exec startxfce4 

Am I missing something?

Any suggestions are very much appreciated. big_smile

Last edited by sync0 (2017-09-11 03:33:58)

Offline

#2 2017-09-08 07:06:29

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,877

Re: [SOLVED] Unable to switch between keyboard input methods using xorg

Output of

setxkbmap -query -print

?
Also try w/o "compose:ralt".

Offline

#3 2017-09-08 09:24:34

sync0
Member
From: Paris
Registered: 2017-09-07
Posts: 7

Re: [SOLVED] Unable to switch between keyboard input methods using xorg

As requested, here is the output of setxkbmap -query -print (I removed compose:ralt as well):

xkb_keymap {
	xkb_keycodes  { include "xfree86+aliases(qwerty)"	};
	xkb_types     { include "complete"	};
	xkb_compat    { include "complete"	};
	xkb_symbols   { include "pc+us(altgr-intl)+inet(pc105)+es(deadtilde):2+kr:3+group(alt_space_toggle)"	};
	xkb_geometry  { include "pc(pc105)"	};
};
rules:      xorg
model:      pc105
layout:     us,es,kr
variant:    altgr-intl,deadtilde,
options:    altwin:super_win,grp:alt_space_toggle

Offline

#4 2017-09-08 10:22:49

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,877

Re: [SOLVED] Unable to switch between keyboard input methods using xorg

Looks ok, does alt_shift toggle work?
Alt+Space if somethimes grabbed by runners (where you can enter commands)

What's the output of

xev -event keyboard | grep space

Offline

#5 2017-09-08 10:37:01

sync0
Member
From: Paris
Registered: 2017-09-07
Posts: 7

Re: [SOLVED] Unable to switch between keyboard input methods using xorg

The output of xev -event keyboard | grep space is:

state 0x0, keycode 65 (keysym 0x20, space), same_screen YES

Btw, I have that XFCE plugin to show the keyboard layout notification, and it shows that the other layouts are active. For some reason, neither ALT + Space nor any other key combination seems to toggle between them. However, I can switch between them manually by clicking on the notification icon.

Offline

#6 2017-09-08 10:40:06

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,877

Re: [SOLVED] Unable to switch between keyboard input methods using xorg

state 0x0 means no alt modifier - there should be state 0x8 or 0x18 (depending on the numlock state)
Log  the xev output of the supposed alt key.

Offline

#7 2017-09-08 10:49:34

sync0
Member
From: Paris
Registered: 2017-09-07
Posts: 7

Re: [SOLVED] Unable to switch between keyboard input methods using xorg

Sorry, I am not very proficient in Linux. Did you mean the output of xev -event keyboard | grep alt? If that is so, this is what it produces:

state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
state 0x8, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,

Likewise, when I press ALT + Space with xev -event keyboard | grep space this is the output:

state 0x8, keycode 65 (keysym 0x20, space), same_screen YES,
state 0x8, keycode 65 (keysym 0x20, space), same_screen YES,

Offline

#8 2017-09-08 11:13:19

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,877

Re: [SOLVED] Unable to switch between keyboard input methods using xorg

Likewise, when I press ALT + Space with xev -event keyboard | grep space this is the output:

That's what I meant. Sorry for not being clear about this.
The output is correct.

Down to basics: remove/comment the variants, the altwin option and use only "us,es"

Offline

#9 2017-09-09 08:24:50

sync0
Member
From: Paris
Registered: 2017-09-07
Posts: 7

Re: [SOLVED] Unable to switch between keyboard input methods using xorg

Now my config file looks like this:

Section "InputClass"
	Identifier "system-keyboard"
	MatchIsKeyboard "on"
        Driver "evdev"
	Option "XkbRules" "xorg"
	Option "XkbModel" "pc105"
	Option "XkbLayout" "us,es"
	Option "XkbOptions" "grp:alt_space_toggle" 
EndSection

Somehow, I still can't toggle using ALT + Space. The output of setxkbmap -query -print is:

xkb_keymap {
	xkb_keycodes  { include "xfree86+aliases(qwerty)"	};
	xkb_types     { include "complete"	};
	xkb_compat    { include "complete"	};
	xkb_symbols   { include "pc+us+inet(pc105)+es:2+group(alt_space_toggle)"};
	xkb_geometry  { include "pc(pc105)"	};
};
rules:      xorg
model:      pc105
layout:     us,es
options:    grp:alt_space_toggle

Offline

#10 2017-09-09 08:56:46

sync0
Member
From: Paris
Registered: 2017-09-07
Posts: 7

Re: [SOLVED] Unable to switch between keyboard input methods using xorg

One update. By using the command setxkbmap -layout "us,es" -option "grp:alt_space_toggle", I was, finally, able to toggle between keyboard layouts. However, my arrow keys stop working.

I wonder if the problem is that the xorg configuration file is, somehow, being skipped or not read properly.

Offline

#11 2017-09-09 14:56:39

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,877

Re: [SOLVED] Unable to switch between keyboard input methods using xorg

What does "setxkbmap -query -print" look afterwards?
I'd rather say xfce or the DM messes up things inbetween, mapping symbols or whatnot, so the next try would be an openbox session (or just an xterm) along "startx", on the latter see https://wiki.archlinux.org/index.php/Xinitrc

Offline

#12 2017-09-11 03:31:49

sync0
Member
From: Paris
Registered: 2017-09-07
Posts: 7

Re: [SOLVED] Unable to switch between keyboard input methods using xorg

Wow. Finally, it works! I still don't know what the problem was, but deleting ~/.Xmodmap did the trick. It seems that xkb and Xmodmap were conflicting somehow. But, again, I am not entirely sure. Thank you so much for your help, seth!

Offline

Board footer

Powered by FluxBB