Re: [Bug 19947] xkbcomp-1.0.5: Group width mismatch between key and type

2009-02-23 Thread Martin MOKREJŠ
Hi Peter,
  thanks for excellent explanations. More below.

Peter Hutterer wrote:
 (**) Option xkb_rules evdev
 (**) AT Translated Set 2 keyboard: xkb_rules: evdev
 (**) Option xkb_model evdev
 (**) AT Translated Set 2 keyboard: xkb_model: evdev
 (**) Option xkb_layout us,cz
 (**) AT Translated Set 2 keyboard: xkb_layout: us,cz
 (**) Option xkb_variant ,qwerty
 (**) AT Translated Set 2 keyboard: xkb_variant: ,qwerty
 (**) Option xkb_options 
 grp:alt_shift_togglegrp_led:scrollcaps:shift_nocancel
 (**) AT Translated Set 2 keyboard: xkb_options: 
 grp:alt_shift_togglegrp_led:scrollcaps:shift_nocancel
 
 this last line is wrong, see below.
 
 xkb_keymap {
 xkb_keycodes evdev+aliases(qwerty) {
 [...]
  
 xkb_types complete {
 [...]
 
 xkb_compatibility complete {
 [...]
 
 xkb_symbols pc+us+cz(qwerty):2+inet(evdev) {
 [...]
 
 this is what actually is loaded in the server. You see how all your options
 are missing? This is because of a wrong setup (fdi file below).

Until one know how it should look like it is not that clear.
Now I see what had to be there:

(II) config/hal: Adding input device AT Translated Set 2 keyboard
(**) AT Translated Set 2 keyboard: always reports core events
(**) AT Translated Set 2 keyboard: Device: /dev/input/event4
(II) AT Translated Set 2 keyboard: Found keys
(II) AT Translated Set 2 keyboard: Configuring as keyboard
(II) XINPUT: Adding extended input device AT Translated Set 2 keyboard (type: 
KEYBOARD)
(**) Option xkb_rules evdev
(**) Option xkb_model pc105
(**) Option xkb_layout us,cz
(**) Option xkb_variant ,qwerty
(**) Option xkb_options 
grp:alt_shift_toggle,grp_led:scroll,caps:shift_nocancel

  
 key LFSH { [ Shift_L ] };
 key RTSH { [ Shift_R ] };
 key LALT { [   Alt_L,  Meta_L ] };
 key RALT {
 type[group2]= ONE_LEVEL,
 symbols[Group1]= [   Alt_R,  Meta_R ],
 symbols[Group2]= [ ISO_Level3_Shift ]
 };
 
 here's the details why it doesn't work, the Alt/Shift keys dont have the
 required ISO_Next_Group, ISO_Prev_Group they should have, hence group
 switching doesn't work.


So here is what I have now compared to the former/broken:

# xkbcomp :0 -xkb out.xkb3
# diff -u -w out.xkb out.xkb3
--- out.xkb 2009-02-12 17:54:32.0 +0100
+++ root/out.xkb3   2009-02-23 16:56:36.0 +0100
@@ -291,7 +291,7 @@
 alias LatM = AB07;
 };
 
-xkb_types complete {
+xkb_types complete+caps(shift_nocancel) {
 
 virtual_modifiers 
NumLock,Alt,LevelThree,LAlt,RAlt,RControl,LControl,ScrollLock,LevelFive,AltGr,Meta,Super,Hyper;
 
@@ -309,6 +309,7 @@
 modifiers= Shift+Lock;
 map[Shift]= Level2;
 map[Lock]= Level2;
+map[Shift+Lock]= Level2;
 level_name[Level1]= Base;
 level_name[Level2]= Caps;
 };
@@ -489,10 +490,11 @@
 modifiers= Shift+Lock+LevelThree;
 map[Shift]= Level2;
 map[Lock]= Level2;
+map[Shift+Lock]= Level2;
 map[LevelThree]= Level3;
 map[Shift+LevelThree]= Level4;
 map[Lock+LevelThree]= Level4;
-map[Shift+Lock+LevelThree]= Level3;
+map[Shift+Lock+LevelThree]= Level4;
 level_name[Level1]= Base;
 level_name[Level2]= Shift;
 level_name[Level3]= Alt Base;
@@ -502,6 +504,7 @@
 modifiers= Shift+Lock+LevelThree;
 map[Shift]= Level2;
 map[Lock]= Level2;
+map[Shift+Lock]= Level2;
 map[LevelThree]= Level3;
 map[Shift+LevelThree]= Level4;
 map[Lock+LevelThree]= Level3;
@@ -582,7 +585,7 @@
 };
 };
 
-xkb_compatibility complete {
+xkb_compatibility complete+ledscroll(group_lock) {
 
 virtual_modifiers 
NumLock,Alt,LevelThree,LAlt,RAlt,RControl,LControl,ScrollLock,LevelFive,AltGr,Meta,Super,Hyper;
 
@@ -1048,8 +1051,7 @@
 modifiers= NumLock;
 };
 indicator Scroll Lock {
-whichModState= locked;
-modifiers= ScrollLock;
+groups= 0xfe;
 };
 indicator Shift Lock {
 !allowExplicit;
@@ -1066,7 +1068,7 @@
 };
 };
 
-xkb_symbols pc+us+cz(qwerty):2+inet(evdev) {
+xkb_symbols pc+us+cz(qwerty):2+inet(evdev)+group(alt_shift_toggle) {
 
 name[group1]=USA;
 name[group2]=Czechia - qwerty;
@@ -1278,7 +1280,10 @@
 symbols[Group1]= [   grave,  asciitilde ],
 symbols[Group2]= [   semicolon,  dead_abovering,   grave,  
asciitilde ]
 };
-key LFSH { [ Shift_L ] };
+key LFSH {
+type= PC_ALT_LEVEL2,
+symbols[Group1]= [ Shift_L,  ISO_Prev_Group ]
+};
 key BKSL {
 type[group2]= FOUR_LEVEL,
 symbols[Group1]= [   backslash, bar ],
@@ -1341,12 +1346,15 @@
 symbols[Group1]= [   slash,question ],
 symbols[Group2]= [   minus,  underscore,asterisk,  
 dead_abovedot ]
 };
-key RTSH { [ Shift_R ] };
+key RTSH {

Re: [Bug 19947] xkbcomp-1.0.5: Group width mismatch between key and type

2009-02-23 Thread Martin MOKREJŠ
Martin MOKREJŠ wrote:

Forgot to add that the [alt]+[shift] switch works with the setup I have now.
Only I suspect that [shift]+twice pressing [=] on the US keyboard layout
followed by pressing [u] should generate ů instead of ˇu. But, the character
is anyway mapped over the [;] character of US layout.

Is there a way to get a graphical layout of the expected buttons from
my installation and some reference layout (gif/jpg/ps or X11 live app)?

I see xvkbd but it does not change its output if I switch between the
keyboard layouts:

$ xvkbd
xvkbd: Mode_switch not available as a modifier
xvkbd: although ISO_Level3_Shift is used instead, AltGr may not work correctly
xvkbd: Mode_switch not available as a modifier
xvkbd: although ISO_Level3_Shift is used instead, AltGr may not work correctly
xvkbd: Mode_switch not available as a modifier
xvkbd: although ISO_Level3_Shift is used instead, AltGr may not work correctly
xvkbd: Mode_switch not available as a modifier
xvkbd: although ISO_Level3_Shift is used instead, AltGr may not work correctly
$

Thanks
Martin

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: [Bug 19947] xkbcomp-1.0.5: Group width mismatch between key and type

2009-02-22 Thread Dan Nicholson
On Sat, Feb 21, 2009 at 11:15 AM, Martin MOKREJŠ
mmokr...@ribosome.natur.cuni.cz wrote:
 Hi,
  would anybody please tell me what is wrong on my system
 so that the alt+shift switch does not work?

I don't really understand the XKB issue, but I can tell you a bit
about how the server operates on XKB data.

  Should I use in HAL .fdi files input.xkb.layout or
 input.x11_options.XkbLayout?

Either one, although input.xkb.layout is preferred (I think).

  I don't know the internals of xorg server, so ... I am puzzled why
 the /usr/bin/xkbcomp is being called twice, as logged in Xorg.0.log.
 I even cannot find the file to existing for teh currently running
 instance:

The server pipes xkb source data to xkbcomp, which outputs a compile
.xkm file. The server then loads the file and destroys it. It happens
twice because once is the keymap for the core keyboard, and once is
the keymap for the device. Hopefully one day this interaction can suck
less, but my guess is that your bug lies elsewhere in XKB.

--
Dan
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: [Bug 19947] xkbcomp-1.0.5: Group width mismatch between key and type

2009-02-22 Thread Martin MOKREJŠ
Dan Nicholson wrote:
 On Sat, Feb 21, 2009 at 11:15 AM, Martin MOKREJŠ
 mmokr...@ribosome.natur.cuni.cz wrote:
  I don't know the internals of xorg server, so ... I am puzzled why
 the /usr/bin/xkbcomp is being called twice, as logged in Xorg.0.log.
 I even cannot find the file to existing for teh currently running
 instance:
 
 The server pipes xkb source data to xkbcomp, which outputs a compile
 .xkm file. The server then loads the file and destroys it. It happens
 twice because once is the keymap for the core keyboard, and once is
 the keymap for the device. Hopefully one day this interaction can suck
 less, but my guess is that your bug lies elsewhere in XKB.

Thanks Dan, actually it seems it is called always when I go a console
mode from X or while returning (ctrl+alt+F[0-6] or alt+F7). After a while
I see it simply multiple times.

Probably the problem is with my keyboard map then. Lets see who else can
speak up. ;-)

-- 
Martin

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: [Bug 19947] xkbcomp-1.0.5: Group width mismatch between key and type

2009-02-22 Thread Peter Hutterer
On Sat, Feb 21, 2009 at 08:15:36PM +0100, Martin MOKREJŠ wrote:
   Should I use in HAL .fdi files input.xkb.layout or
 input.x11_options.XkbLayout?

the latter is for X server specifics, the former for system-wide
configuration (e.g. . The latter overrides the former. Both are fine to set.
For example, in Fedora we set the input.xkb.* keys automatically from
/etc/sysconfig/keyboard, but you can override them through the x11_options for
specific devices if you need to.
 
   I don't know the internals of xorg server, so ... I am puzzled why
 the /usr/bin/xkbcomp is being called twice, as logged in Xorg.0.log.
 I even cannot find the file to existing for teh currently running
 instance:

xkbcomp is called once for each keyboard (i.e. once for each
input.capabilities = input.keyboard device).
you most likely have multiple of those.

 (**) Option xkb_rules evdev
 (**) AT Translated Set 2 keyboard: xkb_rules: evdev
 (**) Option xkb_model evdev
 (**) AT Translated Set 2 keyboard: xkb_model: evdev
 (**) Option xkb_layout us,cz
 (**) AT Translated Set 2 keyboard: xkb_layout: us,cz
 (**) Option xkb_variant ,qwerty
 (**) AT Translated Set 2 keyboard: xkb_variant: ,qwerty
 (**) Option xkb_options 
 grp:alt_shift_togglegrp_led:scrollcaps:shift_nocancel
 (**) AT Translated Set 2 keyboard: xkb_options: 
 grp:alt_shift_togglegrp_led:scrollcaps:shift_nocancel

this last line is wrong, see below.

 xkb_keymap {
 xkb_keycodes evdev+aliases(qwerty) {
[...]
 
 xkb_types complete {
[...]

 xkb_compatibility complete {
[...]

 xkb_symbols pc+us+cz(qwerty):2+inet(evdev) {
[...]

this is what actually is loaded in the server. You see how all your options
are missing? This is because of a wrong setup (fdi file below).

when I run setxkbmap with the settings you're presumably trying to get:
$ setxkbmap -layout us,cz -variant ,qwerty -option grp:alt_shift_toggle\
 -option grp_led:scroll -option caps:shift_nocancel -print 
xkb_keymap {
xkb_keycodes  { include evdev+aliases(qwerty) };
xkb_types { include complete+caps(shift_nocancel) };
xkb_compat{ include complete+ledscroll(group_lock)};
xkb_symbols   { include 
pc+us+cz(qwerty):2+inet(evdev)+group(alt_shift_toggle)};
xkb_geometry  { include pc(pc104) };
};

this command should work for you. (remove the -print option to set it and check 
the server log)


 key LFSH { [ Shift_L ] };
 key RTSH { [ Shift_R ] };
 key LALT { [   Alt_L,  Meta_L ] };
 key RALT {
 type[group2]= ONE_LEVEL,
 symbols[Group1]= [   Alt_R,  Meta_R ],
 symbols[Group2]= [ ISO_Level3_Shift ]
 };

here's the details why it doesn't work, the Alt/Shift keys dont have the
required ISO_Next_Group, ISO_Prev_Group they should have, hence group
switching doesn't work.

 ?xml version=1.0 encoding=utf-8?
 !--
 Identifier Logitech Internet Keyboard
 Option XkbLayout us,cz
 Option XkbVariant,qwerty
 Option XkbOptions
 grp:alt_shift_toggle,grp_led:scroll,caps:shift_nocancel
 
 # instead of the above allow AllowEmptyInput and define the hal rules
 Option AllowEmptyInput True
 --
 !-- http://cgit.freedesktop.org/xorg/xserver/tree/config/x11-input.fdi --
 deviceinfo version=0.2
   device
match key=info.capabilities contains=input.mouse
   merge key=input.x11_driver type=stringmouse/merge
   match key=/org/freedesktop/Hal/devices/computer:system.kernel.name 
 string=Linux
 merge key=input.x11_driver type=stringevdev/merge
   /match
/match
 
match key=info.capabilities contains=input.keyboard
   merge key=input.x11_driver type=stringevdev/merge
   merge key=input.xkb.rules type=stringxorg/merge
   merge key=input.xkb.model type=stringevdev/merge
   merge key=input.xkb.layout type=stringus,cz/merge
   merge key=input.xkb.variant type=string,qwerty/merge
   !-- replace 'strlist' with 'string' on 'input.xkb.options' lines,
see http://bugs.gentoo.org/show_bug.cgi?id=237742#c5 --
   merge key=input.xkb.options 
 type=stringgrp:alt_shift_toggle/merge
   append key=input.xkb.options type=stringgrp_led:scroll/append
   append key=input.xkb.options 
 type=stringcaps:shift_nocancel/append
/match
 
match key=info.product contains=Video Bus
   remove key=input.x11_driver/
   remove key=input.xkb/
/match
 

I hope this is the actual part that takes effect, because with all the bits
that are comments in that file I lost track of what actually matters now. In
the future, please remove things that look like configurations but are just
comments.
 
Anyway, this explains your troubles, xkb options need to be separated
by commas, you're just appending strings (a leftover from what I guess used to
be your strlist configuration), leading to the string we saw in the log. this
string doesn't represent a valid option, so nothing