Bug 540958

Summary: yast2 keyboard module missing/useless in X
Product: [openSUSE] openSUSE 11.2 Reporter: Ludwig Nussel <lnussel>
Component: YaST2Assignee: Jiří Suchomel <jsuchome>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Major    
Priority: P3 - Medium CC: coolo, jdsn, jsuchome
Version: Milestone 7   
Target Milestone: RC 1   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Ludwig Nussel 2009-09-22 09:55:31 UTC
the yast2 keyboard module is not displayed in the control center. When called manually it tells that it can't change the keyboard in X. That's not quite true though the xdm script contains an ugly hack to set the X keyboard according to /etc/sysconfig/keyboard. So the yast2 keyboard module should be re-enabled for X. It needs to tell the user to reboot for changes to take effect though *sigh*.
Comment 1 Jiří Suchomel 2009-09-22 13:05:46 UTC
The YaST module for X11 keyboard was dropped.
Comment 2 Stefan Dirsch 2009-09-22 13:17:01 UTC
The YaST/sax2 modules for keyboard/mouse have been dropped by intention. INVALID.
Comment 3 Ludwig Nussel 2009-09-22 13:35:43 UTC
a special module is not required. the module that sets the keyboard in text mode also works for X (after reboot/rcxdm restart).
Comment 4 Stefan Dirsch 2009-09-22 15:07:20 UTC
Still the only thing you can do is changing the keyboard for the Linux console. It gets mapped to some basic X keyboard, but that is different to what users were used to with SaX2. People need to learn to use the keyboard config tool of their
desktop. Period.
Comment 5 Ludwig Nussel 2009-09-23 07:27:14 UTC
Maybe I'm blind but XFCE which is offered during installation doesn't seem to have such a tool (it's only for key repeat etc but not for the layout). Also that tool wouldn't change the keyboard in xdm either.

Due to the missing desktop file the keyboard config module doesn't show up in text mode either btw.
Comment 6 Stefan Dirsch 2009-09-23 07:48:48 UTC
How crappy is this xfce desktop? For desktops/WMs, which don't have such a tool, you can still use setxkbmap.

There should be still a module for changing the keyboard for the Linux console. Jens-Daniel?
Comment 7 Ludwig Nussel 2009-09-23 08:05:57 UTC
(In reply to comment #6)
> How crappy is this xfce desktop? For desktops/WMs, which don't have such a
> tool, you can still use setxkbmap.

Yeah, sure. *cough*

> There should be still a module for changing the keyboard for the Linux console.
> Jens-Daniel?

There is. It's just not shown and refuses to work when called in X. Due to your keytable4hal hack in rcxdm the settings made by those module also work for X. So re-enabling the module without that exception for X will make everyone happy.
Comment 8 Jiří Suchomel 2009-09-23 09:15:16 UTC
It is possible to call that YaST module in text mode, and it will be able to change the console keyboard map.
Comment 9 Stefan Dirsch 2009-09-23 09:17:55 UTC
Not sure how to run this module at all. And I'm sure that people will complain that the "new" keyboard module misses now the ability to configure the model, variant, etc, i.e. you can only select the layout. 

I believe it's better to force people to use the desktop keyboard tool - if available.
Comment 10 Stefan Dirsch 2009-09-23 09:18:21 UTC
(In reply to comment #8)
> It is possible to call that YaST module in text mode, and it will be able to
> change the console keyboard map.

Indeed. It's now called "GPM configuration".
Comment 11 Stefan Dirsch 2009-09-23 09:18:50 UTC
Wrong. This is the mouse configuration.
Comment 12 Stefan Dirsch 2009-09-23 09:20:24 UTC
I can't find a keyboard module in the list of 'yast -l'. Also not in the 'Hardware' menu.
Comment 13 Stefan Dirsch 2009-09-23 09:22:26 UTC
Or is it in System|Language?
Comment 14 Jiří Suchomel 2009-09-23 09:24:05 UTC
You have to run it directly as 'yast keyboard'

It was dropped from the menu by your request. IIMHO it is not possible to show it in ncurses menu but exclude from graphical menu.
Comment 15 Stefan Dirsch 2009-09-23 09:40:45 UTC
> You have to run it directly as 'yast keyboard'

Oh. This is very well hidden. :-)

> It was dropped from the menu by your request. 

Yes, I requested that the graphics yast keyboard module should no longer start sax2.

> IIMHO it is not possible to show it in ncurses menu but exclude from graphical 
> menu.

Didn't know this. I assumed that it is still possible to configure your Linux console keyboard layout with the text mode yast.
Comment 16 Ludwig Nussel 2009-09-23 09:41:26 UTC
(In reply to comment #9)
> Not sure how to run this module at all. And I'm sure that people will complain
> that the "new" keyboard module misses now the ability to configure the model,
> variant, etc, i.e. you can only select the layout. 

Better than nothing at all. After all that's the only thing you can
set during installation too.
Comment 17 Jiří Suchomel 2009-09-23 09:45:26 UTC
Ludwig. 'yast keyboard' works for you, doesn't it?

I could return it to menu, and show the popup mentioned in comment 0 when started in graphical mode...
Comment 18 Ludwig Nussel 2009-09-23 10:00:26 UTC
(In reply to comment #17)
> Ludwig. 'yast keyboard' works for you, doesn't it?

Yes, works fine if I remove the early exit.
 
> I could return it to menu, and show the popup mentioned in comment 0 when
> started in graphical mode...

Enhancement bug 541351 would also remove the need for reboot.
Comment 19 Ludwig Nussel 2009-09-23 10:00:48 UTC
reopen and re-assign
Comment 20 Jiří Suchomel 2009-09-23 11:37:27 UTC
(In reply to comment #18)
> (In reply to comment #17)
> > Ludwig. 'yast keyboard' works for you, doesn't it?
> 
> Yes, works fine if I remove the early exit.

Which 'early exit' do you mean?
Comment 21 Ludwig Nussel 2009-09-23 12:16:17 UTC
-    map display_info   = (map) UI::GetDisplayInfo ();
-    if (!display_info["TextMode"]:true)
-    {
-       // sax2 does not configure keyboard
-       Popup::Message (_("YaST can no longer be used for changing X11 keyboard layout.
-Use the application provided for your desktop."));
-       return `cancel;
-    }
Comment 22 Ludwig Nussel 2009-09-23 12:16:48 UTC
'yast2 keyboard' that is. 'yast keyboard' of course works always
Comment 23 Jiří Suchomel 2009-09-23 16:21:01 UTC
Looks like we are discussing different things aren't we?

In comment 17 I wrote:

"I could return it to menu, and show the popup mentioned in comment 0 when
started in graphical mode..."

but you are complaining exactly about this popup in comment 22.

I will _not_ remove it, because it does not have ant sense to run YaST keyboard configuration in X11 mode: here it (even in previous releases) only started SaX, which lacks the keyboard config anyway.
Comment 24 Ludwig Nussel 2009-09-24 09:07:51 UTC
(In reply to comment #23)
> Looks like we are discussing different things aren't we?
> 
> In comment 17 I wrote:
> 
> "I could return it to menu, and show the popup mentioned in comment 0 when
> started in graphical mode..."
> 
> but you are complaining exactly about this popup in comment 22.

Ah, I thought you were referring to my suggestion to tell the user to reboot.

> I will _not_ remove it, because it does not have ant sense to run YaST keyboard
> configuration in X11 mode: here it (even in previous releases) only started
> SaX, which lacks the keyboard config anyway.

No, it's different now. It's correct that the keyboard module called
sax2 in the past and shouldn't do that anymore now as xorg.conf is
gone. However, there's a hack in the xdm init script that uses a
mapping table¹ to set the X keyboard according to the console
keyboard. Ie KEYTABLE in /etc/sysconfig/keyboard now also has a
meaning for X! So it't perfectly fine to use the yast keyboard
module in X now without calling sax2.

[1] /usr/share/sax/sysp/maps/Keyboard.map
Comment 25 Jiří Suchomel 2009-09-24 10:08:05 UTC
Wow, but this is totally new to me.

 Anyway, this is more a hack so I don't know if we should present it to user. The preferred way should be using some desktop tool.

BTW, is there any feature request covering what is really needed for YaST keybaord module?
Comment 26 Ludwig Nussel 2009-09-24 10:13:36 UTC
(In reply to comment #25)
> Wow, but this is totally new to me.

Yeah, I was surprised too.
 
>  Anyway, this is more a hack so I don't know if we should present it to user.
> The preferred way should be using some desktop tool.

Such tools apparently only exist for KDE and GNOME but not for e.g. XFCE or other window managers. Also a per-user desktop tool doesn't fix the keyboard in xdm.

> BTW, is there any feature request covering what is really needed for YaST
> keybaord module?

No idea.
Comment 27 Jiří Suchomel 2009-10-01 11:35:23 UTC
Actually I also need this patch in Keyboard.ycp if I want to allow calling setxbmap on running system:

Index: modules/Keyboard.ycp
===================================================================
--- modules/Keyboard.ycp        (revision 58860)
+++ modules/Keyboard.ycp        (working copy)
@@ -478,7 +478,6 @@

     return
        Arch::x11_setup_needed () &&
-       (Stage::initial () || Stage::firstboot ()) &&
        ! (Linuxrc::serial_console() || Linuxrc::vnc() || Linuxrc::usessh() || Linuxrc::text ());
 }
Comment 28 Jiří Suchomel 2009-10-01 11:39:37 UTC
Patches from comment 21 and comment 27 submitted as part of yast2-country-2.18.20