dual keyboard input (2 language) in X (xorg.conf)
I need to set 2 language options for Xorg, I did this on Suse 11.1, but when they changed to remove the xorg config file, and other changes I am now back to using Slackware.
Currently running Slackware 13.1 full install from DVD. System is AMD 64 Phenom II quad-core. currently my xorg.conf file I have: Section "InputDevice" #Testing Identifier "Keyboard0" Driver "kbd" Option "XkbRules" "xorg" Option "XkbLayout" "us,th" Option "XkbOptions" "grp:alt_shift_toggle" EndSection But the keyboard layout switch function does not work. Already installed Thai fonts and added the font directories to the config file as well. They display fine, not sure what I am doing wrong here though. It seems Slackware does not come with any default Thai lang. support but that should not prevent this from working. Any suggestions would be appreciated. |
Hi,
Shouldn't that be: Option "XkbOptions" "grp:switch,grp:alt_shift_toggle" If you want to let the Scroll Lock LED indicate th is active: Option "XkbOptions" "grp:switch,grp:alt_shift_toggle,grp_led:scroll" Hope this helps. |
(current xorg.conf file) actually the spacing is right in my file but does not display on the forum correctly
Section "InputDevice" #Testing Identifier "Keyboard0" Driver "kbd" Option "XkbRules" "xorg" Option "XkbLayout" "us,th" Option "XkbOptions" "grp:switch,grp:alt_shift_toggle,grp_led:scroll" EndSection Thanks for pointing the "switch" out. Still a no-go though. Maybe something else I am forgetting....? How do I use other key combos? Is there a list of command names that are excepted in the xorg.conf? Ultimately if the regular alt-shift works that is fine, but it would be better to use "~" instead (only 1 key) Is the Rules option necessary [Option "XkbRules" "xorg"] because it is not in the default xorg.conf file. Also Layout language should be two letter abbreviation but is is Capital or lowercase? |
Hi,
The Option "XkbRules" "xorg" line and a missing Option "XkbModel" "pc104" (pc104 being an example) was what I first noticed. BTW: The XKB Configuration Guide Hope this helps. |
Quote:
For some reason editing the config did not work, but the command line did! #setxkbmap -rules xorg -model logic -layout "us,th" \ -option "grp:alt_shift_toggle" If all else fails I will just make a shell script to fix this problem I am having with xorg Thanks for the help!! |
You're welcome :)
|
If need be, you could put that line into your /etc/X11/xinit/xinitrc file (whichever one you're using, or the .xinitrc in your home directory if you have one there) or into your ~/.xsession file if you have one, rather than making a new script somewhere.
You'd need to check the manpage(s) for X to see which location is the "proper" one; on my machine, I have items like that in my /etc/X11/xinit/xinitrc file, but I tend to sometimes not do things exactly as they are intended to be done, so if you want to do it the 'right' way, read a little bit to see where that *should* go. :) |
Quote:
when I use the command line: setxkbmap -rules xorg -model pc104 -layout "us,th" \ -option "grp:alt_shift_toggle" or setxkbmap -rules xorg -model logic -layout "us,th" \ -option "grp:alt_shift_toggle" The arrow keys stop working properly! Also adding this to any of the initrc files under X11 does not work (script does not initiate for some reason, I will put it somewhere else once it works :D) now I am back to square one, unless I find a command that gives me full function (I like using the arrow keys for scrolling) Maybe I will have to buy a new keyboard (new logitech, instead of this no name one), but think this one should work since my wife used it in Windows with dual function capability. If only I could recover the lost Hard Disk with my old configuration, I might have a clue (I saved backups of my config files since it was hard to remember, but lost the drive due to it being an external and the PS failed). Any suggestions or places to find more info on my problem would be greatly appreciated..... |
I don't have a solution to the bit about the arrow keys not working. But a suggestion maybe, would be to add a -variant option? Perhaps your arrow keys are mapped and working, but they aren't mapped to the right keys.. Pure speculation! :)
But have a look at section 2.2 and 2.3 at that guide linked to by Druuna above. Also in there, it shows the -layout options in lowercase, so if that document is accurate, you're fine there. What kind of keyboard is this anyhow? Have you got a make & model of it? I'm also curious - are the back-slashes necessary in that commandline? Or is it just that you were entering it on a commandline in two lines, rather than a single line? |
I just put
Code:
setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,rs,si |
Nice! I'm sure someone besides yourself will find this helpful - hopefully the OP!.
Best regards! |
Quote:
Yep, that seems to work! Was going to remove those options about layout since they were not in my xorg.conf anyway. Thanks for your help! Now I will mess with some init scripts to get this on auto. |
Quote:
So for now I have a temporary fix (prob. not politically correct): made rc script I named "rc.thai" in the /etc/rc.d/ directory the rc.thai script calls the "setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,th" command and then I added the rc.thai script to the end of my rc.M file (my default run level) This works but like I said it is a bit too much trouble, it would have saved me a whole lot of effort if the xorg.conf file editing actually worked, still puzzled as to why it doesn't.... Anyway thanks for the help everyone. I think we should leave this open to more inputs though as the real root of the problem (xorg.conf) still does not work with this option. I wonder if anyone else running Slackware 13.1 has this problem.....? |
Well, I guess that your way is just as good as any other. There's more than one way to skin a cat in linux. I personally like to make any customization in my user config files (that way I don't lose it after reinstall), so if I were using KDE (like you probably), I would write that line in some script and put it in ~/.kde/Autostart
As for xorg... This is from my old xorg.conf (slack 12.2 I believe) and that worked for me. As I can see only thing thats different from your is addition of keyboard model and identifier is Keyboard1 instead of Keyboard0. Code:
Section "InputDevice" |
@OP
X use hal in Slackware, so you have to use /etc/hal/fdi/policy/10-keymap.fdi for the keyboard configuration. If you don't have that file, copy it from /usr/share/hal/fdi/policy/10osvendor/10-keymap.fdi and edit the varous <merge key=...> tags, to look like: Code:
<merge key="input.xkb.rules" type="string">base</merge> Code:
/etc/rc.d/rc.hald restart Code:
Section "ServerFlags" |
All times are GMT -5. The time now is 04:35 AM. |