Bug 105420

Summary: no kbd shortcut for changing keybord layout in xorg.conf
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Ladislav Michnovic <lmichnovic>
Component: SaX2Assignee: Marcus Schaefer <ms>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: sndirsch
Version: Beta 2   
Target Milestone: ---   
Hardware: Other   
OS: All   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Ladislav Michnovic 2005-08-18 08:26:29 UTC
I've choose in YAST two keyboard layout (one English US basic as default, second
SK qwerty as complementary). I've wanted to solve out what is the shortcut for
changing the layouts, but in /etc/X11/xorg.conf is only :
Section "InputDevice"
  Driver       "kbd"
  Identifier   "Keyboard[0]"
  Option       "Protocol" "Standard"
  Option       "XkbLayout" "us,sk"
  Option       "XkbModel" "pc104"
  Option       "XkbRules" "xfree86"
  Option       "XkbVariant" ",qwerty"
EndSection

But line 
  Option       "grp:alt_shift_toggle" 
or something equivalent is missing.
Or is there now a another way how to switch between kbd layouts?
Comment 1 Stefan Dirsch 2005-08-18 08:30:18 UTC
This sounds more like a SaX2 issue.
Comment 2 Marcus Schaefer 2005-08-18 08:34:59 UTC
default is  
  
     shift+shift  
  
to switch group 
Comment 3 Ladislav Michnovic 2005-08-18 09:02:20 UTC
(In reply to comment #2)
> default is  
>   
>      shift+shift  
>   
> to switch group 
Shift-shift is not working. 
IMHO without any Option in xorg.conf there's no way to change it.
Comment 4 Ladislav Michnovic 2005-08-18 09:05:51 UTC
Shift+shift is not the solution. 
Comment 5 Stefan Dirsch 2005-08-18 09:07:06 UTC
*** Bug 105430 has been marked as a duplicate of this bug. ***
Comment 6 Marcus Schaefer 2005-08-18 09:07:37 UTC
there was a default to shift+shift if this has changed in xkb we 
should fix it. Assigned to Stefan 
Comment 7 Marcus Schaefer 2005-08-18 09:09:52 UTC
sorry I missed the :-) Stefan there was a default toggle switch 
please activate it again. Thanks 
Comment 8 Ladislav Michnovic 2005-08-18 09:45:32 UTC
I've added a line in my xorg.conf
  Option       "grp:alt_shift_toggle" 
but it's useles. How to switch between layouts in SL 10 Beta 2 ?

I have a suggestion for Sax2 usability. When choosing a kbd layouts and variant,
there should be also possibility to choose a shortcut, that will change the kbd
layout when X is started. (Not everyone is using KDE.)
For a shortcut I propose whithin double Shift also leftAlt+leftShift (MS
Windowslike).
Comment 9 Stefan Dirsch 2005-08-18 09:58:54 UTC
Hmm, but Alt-Shift seems to be the default toggle now.

setxkbmap -layout cz,us -v
Warning! Multiple definitions of keyboard layout
         Using command line, ignoring X server
Trying to build keymap using the following components:
keycodes:   xfree86+aliases(qwertz)
types:      complete
compat:     complete
symbols:   
pc(pc105)+cz+us:2+group(shifts_toggle)+group(toggle)+group(shifts_toggle)+group(alt_shift_toggle)
geometry:   pc(pc105)
Comment 10 Stefan Dirsch 2005-08-18 10:20:13 UTC
I should have read the manpage of setxkbmap more carefully. Please try this:

  setxkbmap -layout cz,us -option "" -v
  setxkbmap -layout cz,us -option "" -option "shift_toggle"

(for Shift-Shift toggle)

  setxkbmap -layout cz,us -option "" -v
  setxkbmap -layout cz,us -option "" -option "alt_shift_toggle"

(for Alt-Shift toggle)
Comment 11 Ladislav Michnovic 2005-08-18 11:45:28 UTC
I have tried this:
>   setxkbmap -layout cz,us -option "" -v
>   setxkbmap -layout cz,us -option "" -option "shift_toggle"

But something is wrong.
If I'm pressing both shifts or anything, I always have cz layout.
My windowmanager is Windowmaker.
Comment 12 Ladislav Michnovic 2005-08-18 11:49:06 UTC
 setxkbmap -layout cz,us -v
Warning! Multiple definitions of keyboard layout
         Using command line, ignoring X server
Trying to build keymap using the following components:
keycodes:   xfree86+aliases(qwertz)
types:      complete
compat:     complete
symbols:    pc(pc104)+cz+us:2
geometry:   pc(pc104)
Comment 13 Stefan Dirsch 2005-08-18 12:10:59 UTC
Please add the output of 

  setxkbmap -layout cz,us -option "" -v
  setxkbmap -layout cz,us -option "" -option "shift_toggle" -v
Comment 14 Ladislav Michnovic 2005-08-18 13:34:54 UTC
Sorry for mystifying, I corrected the bad line 
BAD       Option       "grp:alt_shift_toggle"
CORRECT   Option       "XkbOptions" "grp:shift_toggle"
                        ^^^^^^^^^^
and it's functioning now.

But the whole problem is, that after setting keyboard layout in SAX2, generated
file /etc/X11/xorg.conf doesn't contain line:
 
 Option       "XkbOptions" "grp:shift_toggle"

in Section "InputDevice".

The output, You asked for, is here, but see more below for solution: 

lmichnovic@zuzka:~>  setxkbmap -layout cz,us -option "" -v
Warning! Multiple definitions of keyboard layout
         Using command line, ignoring X server
Trying to build keymap using the following components:
keycodes:   xfree86+aliases(qwertz)
types:      complete
compat:     complete
symbols:    pc(pc104)+cz+us:2
geometry:   pc(pc104)

lmichnovic@zuzka:~> setxkbmap -layout cz,us -option "" -option "shift_toggle" -v
Warning! Multiple definitions of keyboard layout
         Using command line, ignoring X server
Trying to build keymap using the following components:
keycodes:   xfree86+aliases(qwertz)
types:      complete
compat:     complete
symbols:    pc(pc104)+cz+us:2
geometry:   pc(pc104)

HERE IS THE USE THAT WORKS:

 setxkbmap -layout cz,us -option "grp:shift_toggle" -v
Warning! Multiple definitions of keyboard layout
         Using command line, ignoring X server
Trying to build keymap using the following components:
keycodes:   xfree86+aliases(qwertz)
types:      complete
compat:     complete
symbols:    pc(pc104)+cz+us:2+group(shifts_toggle)
geometry:   pc(pc104)

The "grp:" was missing in option.
Comment 15 Stefan Dirsch 2005-08-18 13:39:30 UTC
Sorry, my fault. You need "grp:shift_toggle". Anyway, there's still the problem,
that there is no toggle by default. Marcus told me that there is (shift_toggle)
on 9.3. I'm still investigating.
Comment 16 Stefan Dirsch 2005-08-18 17:12:12 UTC
Looks like it was a misinformation that there is a default toggle. Actually
there isn't. Marcus, please set a default toggle for all language with mulitpile
keyboard layouts. We can try to discuss which toggle for which language.
Comment 17 Stefan Dirsch 2005-08-18 18:36:50 UTC
On Thu, Aug 18, 2005 at 06:30:02PM +0100, Sergey V. Udaltsov wrote:  
> > I've been told that with XFree86/X.Org a default toggle "Shift+Shift" 
> > (shift_toggle) is set to change multiple keyboard layouts. Looks like 
> You were misinformed. It was never a case. At least, I never heard of 
> it. GNOME uses default 'alt-alt' - but it explicitly set as an option. 
 
Maybe we should use also "alt-alt" for languages we don't know which toggle to 
set as default? 
Comment 18 Ladislav Michnovic 2005-08-19 06:05:28 UTC
(In reply to comment #16)
> We can try to discuss which toggle for which language.

My oppinion is, that the ultimate solution is create in SAX2 keybord settings
new option for choosing shortcut, to let user set this. 
As default I prefer as windows has leftAlt+leftShift.
Comment 19 Marcus Schaefer 2005-08-19 13:28:20 UTC
fixed, default XKB option will be included: 
 
   Keyboard0 =>  XkbOptions : grp:alt_shift_toggle 
Comment 20 Marcus Schaefer 2005-08-25 10:24:25 UTC
The fix for this bug was invalid, if this option is set and only 
one keyboard layout is used the behavior is weird which is in my opinion 
a bug in XKB. nevertheless I changed the fix to include the toggle 
option only if layout > 1 
Comment 21 Stefan Dirsch 2005-08-25 10:28:43 UTC
Thanks!