LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   dual keyboard input (2 language) in X (xorg.conf) (https://www.linuxquestions.org/questions/slackware-14/dual-keyboard-input-2-language-in-x-xorg-conf-834743/)

slackman77 09-27-2010 09:50 AM

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.

druuna 09-27-2010 10:28 AM

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.

slackman77 09-27-2010 11:41 AM

(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?

druuna 09-27-2010 12:17 PM

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.

slackman77 09-27-2010 12:43 PM

Quote:

Originally Posted by druuna (Post 4110494)
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.

Ok thanks!

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!!

druuna 09-27-2010 12:49 PM

You're welcome :)

GrapefruiTgirl 09-27-2010 12:51 PM

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. :)

slackman77 09-28-2010 07:12 AM

Quote:

Originally Posted by GrapefruiTgirl (Post 4110519)
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. :)

Well now a new problem:
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.....

GrapefruiTgirl 09-28-2010 07:42 AM

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?

diwljina 09-28-2010 09:20 AM

I just put
Code:

setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,rs,si
in one of my startup scripts (e.g. ~/.config/lxsession/LXDE/autostart in LXDE) and everything works fine. No "-model" or "-rules" entries.

GrapefruiTgirl 09-28-2010 09:25 AM

Nice! I'm sure someone besides yourself will find this helpful - hopefully the OP!.

Best regards!

slackman77 09-28-2010 11:26 PM

Quote:

Originally Posted by diwljina (Post 4111461)
I just put
Code:

setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,rs,si
in one of my startup scripts (e.g. ~/.config/lxsession/LXDE/autostart in LXDE) and everything works fine. No "-model" or "-rules" entries.


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.

slackman77 09-29-2010 09:18 AM

Quote:

Originally Posted by diwljina (Post 4111461)
I just put
Code:

setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,rs,si
in one of my startup scripts (e.g. ~/.config/lxsession/LXDE/autostart in LXDE) and everything works fine. No "-model" or "-rules" entries.

where are your startup scripts? I just created an rc.d script but it only works in regular user mode and not in root for some reason?? Not really a problem but I would much rather things work through the xorg.conf the way they are "supposed to"??

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.....?

diwljina 09-29-2010 11:54 AM

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"

    Identifier  "Keyboard1"
    Driver      "kbd"

    Option "XkbRules"  "xorg"
    Option "XkbModel"  "pc105"
    Option "XkbLayout"  "us,rs,si"
    Option "XkbOptions" "grp:switch,grp:alt_shift_toggle,grp_led:scroll"

EndSection

Don't know if that helps.

bathory 09-29-2010 12:08 PM

@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>
      <merge key="input.xkb.model" type="string">evdev</merge>
      <merge key="input.xkb.layout" type="string">us,th</merge>
      <merge key="input.xkb.options" type="string">grp:ctrl_shift_toggle,grp_led:scroll,compose:ralt,terminate:ctrl_alt_bksp</mer$
      <merge key="input.xkb.variant" type="string" />

Of course you need to exit X and restart hald
Code:

/etc/rc.d/rc.hald restart
If you want to go with the traditional xorg.conf options, you need to add in xorg.conf
Code:

Section "ServerFlags"
    Option "AutoAddDevices" "0"
    Option "AllowEmptyInput" "0"
    Option "AutoEnableDevices" "0"
EndSection

Regards


All times are GMT -5. The time now is 04:35 AM.