LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (http://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Cannot change keyboard layout (http://www.linuxquestions.org/questions/linux-hardware-18/cannot-change-keyboard-layout-527347/)

mikerobinson 02-10-2007 01:14 PM

Cannot change keyboard layout
 
I'm using kubuntu 6.10 with KDE 5.5.5. When I go to Regional & Accessibility > Keyboard Layout, everything appears blank. There are no keyboard layouts or keyboard variants to select. I also noticed my /usr/share/keymaps/ directory was empty. The keyboard section of my xorg.conf file is
Quote:

Section "InputDevice"
Identifier "Generic Keyboard"
Driver "keyboard"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "en,es,sp,us"
Option "XkbOptions" "grp:alt_shift_toggle,grp_led:scroll"
EndSection
Anyone have any ideas how I can set up my keyboard so I can switch between english and spanish keyboards?

David the H. 02-12-2007 04:30 AM

At a guess, you don't have the keymaps installed. On Debian the main package containing keymaps is called console-data. I'm not sure if it's still the same on *buntu, but I'll bet it is.

mikerobinson 02-13-2007 01:24 AM

You're right, I didn't have console-data installed, however after installation, it didn't add layouts to the keyboard configuration utility. I also realized that I can get multiple keyboard layouts in Gnome, just not in KDE.

mikerobinson 02-13-2007 01:33 AM

Oh, one more thing i just noticed. When I try to start the configuration tool from a console I get this error:

Quote:

mike@mike:~$ kcmshell keyboard_layout
kcmshell: ERROR: Cannot find rules file in /usr/share/X11/
QComboBox::changeItem: (comboModel) Index 0 out of range
Which rules file are they talking about?

izi 03-20-2007 06:50 AM

Solution (?)
 
Hi there !

I think I've managed to find a solution that doesn't require global changes, scripts or installations (works in Kubuntu 6.10):

1. In the Regional & Language Add the needed layout, disable xkb options

2. Close any language / keyboard settings windows

3. Edit the file ~/.kde/share/config/kdeglobals
Look for the line:
Switch to Next Keyboard Layout=Alt+Ctrl+K
And change to:
Switch to Next Keyboard Layout=Alt+Shift_L;Alt+Shift_R
This will enable layout changes for both alt+shift (left and right) like in windows. You cal eliminte one if you'd like.

4. Open "Keyboard & Mouse", choose "Keyboard shortcuts", and make sure the correct shortcuts appear (they should).

5. Either restart KDE or just change some random keyboard shortcut (and change back) - Just as long as the "apply" button goes active.
6. Press "apply"

Cheers

NOTE: I've only discovered it today and haven't checked for long term effects / damage... I'd appreciate some feedback

izi 03-20-2007 12:48 PM

A script
 
I suppose a possible script would be:

Code:

cp ~/.kde/share/config/kdeglobals ~/.kde/share/config/kdeglobals.old
sed -e 's/Alt+Ctrl+K/Alt+Shift_L;Alt+Shift_R/g' ~/.kde/share/config/kdeglobals.old > ~/.kde/share/config/kdeglobals

NOTE! If you've already changed the keyboard shortcut from ALT+Ctrl+K don't forget to change it in the script...

You may have to re-"apply" your keyboard shortcuts as I've writtem before: Change some random keyboard shortcut (and change back) - Just as long as the "apply" button goes active. Press "apply".

What you achieve is a GNOME-like functionality - ALT+Shift changes language (and the indicator)

Cheers :D

mikerobinson 03-21-2007 02:35 AM

Thanks for the really detailed response, however perhaps you didn't understand my problem correctly. I cannot choose the keyboard layouts in the Regional & Accessibility > Keyboard Layout. It is empty. Here is a screenshot of what I mean.

However, if I ever get it working to switch keyboard layouts, I'll definitely refer to your posts for the switching methods.

lcampagn 01-01-2008 02:48 PM

I had this exact problem. The rules files referred to are:
/usr/share/X11/xkb/rules/xorg
/usr/share/X11/xkb/rules/xfree86

I fixed this by running:
# apt-get install --reinstall xkb-data

I hope this works for you!

melstrom 05-13-2008 03:32 AM

reply to Izi, from Mar 07
 
13 May 2008
00.30 Los Angeles

Izi's solution of editing the ~/.kde/share/config/kdeglobals does indeed work as described (apparently not for mikerobinson's original request). I've been trying in vain, until this solution, to get KDE to switch layouts just as I can with other desktop systems, via the xorg.conf file. Another frustrating example of KDE jiggering with so much that it no longer feels like *nix -- too many options that only KDE knows buried in too many KDE-only layers of stuff.

mikerobinson 05-13-2008 01:33 PM

This problem was fixed a while ago with (I believe) the release of ubuntu 7.04, however if I remember correctly, I had to simlink the keyboard layout files to another directory.

DBabo 04-20-2009 04:54 PM

Izi,
thank you that is the solution to my problem.


Quote:

Originally Posted by izi (Post 2677109)
Hi there !

I think I've managed to find a solution that doesn't require global changes, scripts or installations (works in Kubuntu 6.10):

1. In the Regional & Language Add the needed layout, disable xkb options

2. Close any language / keyboard settings windows

3. Edit the file ~/.kde/share/config/kdeglobals
Look for the line:
Switch to Next Keyboard Layout=Alt+Ctrl+K
And change to:
Switch to Next Keyboard Layout=Alt+Shift_L;Alt+Shift_R
This will enable layout changes for both alt+shift (left and right) like in windows. You cal eliminte one if you'd like.

4. Open "Keyboard & Mouse", choose "Keyboard shortcuts", and make sure the correct shortcuts appear (they should).

5. Either restart KDE or just change some random keyboard shortcut (and change back) - Just as long as the "apply" button goes active.
6. Press "apply"

Cheers

NOTE: I've only discovered it today and haven't checked for long term effects / damage... I'd appreciate some feedback



All times are GMT -5. The time now is 03:25 AM.