Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] wrong keyboard layout in X after update
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Rhiakath
Guru
Guru


Joined: 10 Feb 2006
Posts: 572
Location: Hell...

PostPosted: Tue Jan 11, 2011 4:23 pm    Post subject: [SOLVED] wrong keyboard layout in X after update Reply with quote

Hi there. I just did an emerge --sync && emerge -uavDN world && revdep-rebuild && emerge --depclean -av.

All went ok, except that, for some reason, now my keyboard is in US layout. My hal files remain ok, but i can't get a PT keyboard.

10-x11-input-configuration.fdi
Code:

<?xml version="1.0" encoding="UTF-8"?>
<!--
Section "InputDevice"
   Driver "evdev"
   Option "XkbLayout" "ee"
EndSection
-->
<deviceinfo version="0.2">
   <match key="info.capabilities" contains="input.keyboard">
      <merge key="input.x11_options.XkbLayout" type="string">pt</merge>
   </match>
</deviceinfo>


10-x11-input.fdi
Code:

<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
  <device>

    <!-- KVM emulates a USB graphics tablet which works in absolute coordinate mode -->
    <match key="input.product" contains="QEMU USB Tablet">
       <merge key="input.x11_driver" type="string">evdev</merge>
    </match>

    <!-- FIXME: Support tablets too. -->
    <match key="info.capabilities" contains="input.mouse">
      <merge key="input.x11_driver" type="string">mouse</merge>
      <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
             string="Linux">
        <merge key="input.x11_driver" type="string">evdev</merge>
      </match>
    </match>

    <match key="info.capabilities" contains="input.tablet">
      <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
             string="Linux">
        <merge key="input.x11_driver" type="string">evdev</merge>
      </match>
    </match>

    <match key="info.capabilities" contains="input.touchpad">
      <merge key="input.x11_driver" type="string">mouse</merge>
      <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
             string="Linux">
        <merge key="input.x11_driver" type="string">evdev</merge>
      </match>
    </match>

    <match key="info.capabilities" contains="input.keys">
      <!-- If we're using Linux, we use evdev by default (falling back to
           keyboard otherwise). -->
      <merge key="input.x11_driver" type="string">keyboard</merge>
      <merge key="input.xkb.options" type="string">terminate:ctrl_alt_bksp</merge>
      <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
             string="Linux">
        <merge key="input.x11_driver" type="string">evdev</merge>
      </match>
    </match>
  </device>
</deviceinfo>


10-keymap.fdi
Code:

<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->
<deviceinfo version="0.2">
  <device>
    <match key="info.capabilities" contains="input.keymap">
      <append key="info.callouts.add" type="strlist">hal-setup-keymap</append>
    </match>

    <match key="info.capabilities" contains="input.keys">
      <merge key="input.xkb.rules" type="string">base</merge>

      <!-- If we're using Linux, we use evdev by default (falling back to
           keyboard otherwise). -->
      <merge key="input.xkb.model" type="string">keyboard</merge>
      <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
             string="Linux">
        <merge key="input.xkb.model" type="string">evdev</merge>
      </match>

      <merge key="input.xkb.layout" type="string">pt</merge>
      <merge key="input.xkb.variant" type="string" />
    </match>
  </device>
</deviceinfo>


what is wrong here?
_________________
pc-rhiakath ~ $ emerge -s happiness
Searching..
[ Results for search key : happiness ]
[ Applications found : 0 ]

-------------------------------------------

I see dead pixels...


Last edited by Rhiakath on Tue Jan 18, 2011 10:27 am; edited 1 time in total
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2664
Location: Slovenia

PostPosted: Tue Jan 11, 2011 4:45 pm    Post subject: Reply with quote

http://www.gentoo.org/proj/en/desktop/x/x11/xorg-server-1.9-upgrade-guide.xml
Back to top
View user's profile Send private message
Rhiakath
Guru
Guru


Joined: 10 Feb 2006
Posts: 572
Location: Hell...

PostPosted: Tue Jan 11, 2011 6:13 pm    Post subject: Reply with quote

you've got to be kidding! back to conf files??????
_________________
pc-rhiakath ~ $ emerge -s happiness
Searching..
[ Results for search key : happiness ]
[ Applications found : 0 ]

-------------------------------------------

I see dead pixels...
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6194

PostPosted: Tue Jan 11, 2011 7:30 pm    Post subject: Reply with quote

Yes and no - InputClass is far more flexible.
Back to top
View user's profile Send private message
Rhiakath
Guru
Guru


Joined: 10 Feb 2006
Posts: 572
Location: Hell...

PostPosted: Wed Jan 12, 2011 3:14 pm    Post subject: Reply with quote

hmmm, ok.
before i close this post...
how can i enable ctrl-alt-backspace again?
_________________
pc-rhiakath ~ $ emerge -s happiness
Searching..
[ Results for search key : happiness ]
[ Applications found : 0 ]

-------------------------------------------

I see dead pixels...
Back to top
View user's profile Send private message
Uli Sing
Apprentice
Apprentice


Joined: 03 May 2010
Posts: 190
Location: MUC

PostPosted: Thu Jan 13, 2011 7:43 am    Post subject: Reply with quote

Code:
Option "XkbOptions" "terminate:ctrl_alt_bksp"

works for me.

You live in hell? Never seen you there. :D
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2664
Location: Slovenia

PostPosted: Thu Jan 13, 2011 4:53 pm    Post subject: Reply with quote

Rhiakath wrote:
you've got to be kidding! back to conf files??????

Err, so easily readable conf files are ??????-worthy, but XML files are ok :?: :?:
Back to top
View user's profile Send private message
Uli Sing
Apprentice
Apprentice


Joined: 03 May 2010
Posts: 190
Location: MUC

PostPosted: Thu Jan 13, 2011 5:27 pm    Post subject: Reply with quote

There is definitely no difference between config text or XML files...












...as long as you know what to write in it. ;)
Back to top
View user's profile Send private message
Rhiakath
Guru
Guru


Joined: 10 Feb 2006
Posts: 572
Location: Hell...

PostPosted: Mon Jan 17, 2011 10:45 pm    Post subject: Reply with quote

@Gusar: I do prefer easily readable conf files. I was just upset because i had my config all set up initially, then xorg moved to hal support with their damned fdi files (I do hate XML). after i finally experiment enough to get my X setup exactly how i want it, they go back to conf. Like... are they kidding me?
@Uli Sing: Yes , i'm your neighbour! I'm the guy that plays the guitar really loud on Saturday mornings, and Rammstein at max volume during weekdays ;)
_________________
pc-rhiakath ~ $ emerge -s happiness
Searching..
[ Results for search key : happiness ]
[ Applications found : 0 ]

-------------------------------------------

I see dead pixels...
Back to top
View user's profile Send private message
v_andal
Guru
Guru


Joined: 26 Aug 2008
Posts: 523
Location: Germany

PostPosted: Tue Jan 18, 2011 12:33 pm    Post subject: Reply with quote

VoidMage wrote:
Yes and no - InputClass is far more flexible.


This is true. But isn't it an overkill? One can do the same thing using udev rules directly. Why to add complexity to xorg.conf? In fact it is simpler to configure udev than to use InputClass. I mean, it would be cool if the configuration worked without InputClass and udev tweakening, but quite often it doesn't. And in such cases it is more consistent to tweak udev, than xorg.conf IMHO.

Still, it is definitely better than HAL and .fdi files.
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2664
Location: Slovenia

PostPosted: Tue Jan 18, 2011 3:27 pm    Post subject: Reply with quote

v_andal wrote:
One can do the same thing using udev rules directly.
You can? How do I set up my keyboard layout, 3-button emoulation for my mouse and some settings for my touchpad using udev rules? And how is it simpler than the few Option "blah" lines in xorg.conf?
Back to top
View user's profile Send private message
v_andal
Guru
Guru


Joined: 26 Aug 2008
Posts: 523
Location: Germany

PostPosted: Tue Jan 18, 2011 4:02 pm    Post subject: Reply with quote

Gusar wrote:
v_andal wrote:
One can do the same thing using udev rules directly.
You can? How do I set up my keyboard layout, 3-button emoulation for my mouse and some settings for my touchpad using udev rules? And how is it simpler than the few Option "blah" lines in xorg.conf?


Probably you have misunderstood me. I just said that InputClass sections do not make sense. You can still use InputDevice sections to configure your touchpad and keyboard layout. The only thing that you need for them is the consistent path for Option "Device". This can be achieved using udev configuration.
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2664
Location: Slovenia

PostPosted: Tue Jan 18, 2011 4:57 pm    Post subject: Reply with quote

So instead of just using InputClass, I would need to configure an InputDevice section *and* and udev rule. Which have a different syntax and I'd need to check out two places on how exactly to configure what I want. Yes, much simpler, totally agree.
Back to top
View user's profile Send private message
Rhiakath
Guru
Guru


Joined: 10 Feb 2006
Posts: 572
Location: Hell...

PostPosted: Tue Jan 18, 2011 11:09 pm    Post subject: Reply with quote

You forgot to use the tags:

<sarcasm> and </sarcasm>

:)

I must agree on one thing. It would definitely be good to have a central place to configure all this. udev is WAY easier than hal and those damned fdi files, sure.

the xorg.conf files are even easier. But, if all could be configured in udev, and nowhere else.... To unify the whole system configuration.
_________________
pc-rhiakath ~ $ emerge -s happiness
Searching..
[ Results for search key : happiness ]
[ Applications found : 0 ]

-------------------------------------------

I see dead pixels...
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6194

PostPosted: Tue Jan 18, 2011 11:31 pm    Post subject: Reply with quote

Too much unification is not necessarily a good thing.
Back to top
View user's profile Send private message
Rhiakath
Guru
Guru


Joined: 10 Feb 2006
Posts: 572
Location: Hell...

PostPosted: Wed Jan 19, 2011 9:58 am    Post subject: Reply with quote

No, of course not. "Too much of something is bad enough...", so said the spice girls...

But, it sure would be nice to have a standard. Like, net configuration has a certain syntax. keyboard configuration has another syntax. keyboard for X, has another syntax and another file.
I just meant... why not just create a standard way of doing things? Create a conf.d folder that contains all configuration files. it would be super-handy when you want to reinstall :)
that's what i mean by unification. I don't mean, for example, to create a windows registry in linux. No, thank you.
_________________
pc-rhiakath ~ $ emerge -s happiness
Searching..
[ Results for search key : happiness ]
[ Applications found : 0 ]

-------------------------------------------

I see dead pixels...
Back to top
View user's profile Send private message
v_andal
Guru
Guru


Joined: 26 Aug 2008
Posts: 523
Location: Germany

PostPosted: Wed Jan 19, 2011 10:03 am    Post subject: Reply with quote

Gusar wrote:
So instead of just using InputClass, I would need to configure an InputDevice section *and* and udev rule. Which have a different syntax and I'd need to check out two places on how exactly to configure what I want. Yes, much simpler, totally agree.


Well. One has to learn how to configure udev anyway. Device files are used not only in X. Besides, InputClass uses the information from udev and to use it one has to learn about udev. Here comes the worst. Neither udev, nor InputClass is fully documented. Do you know for example, which information is for matching by MatchVendor condition, or MatchTag? Or maybe you know why MatchIsKeyboard matches my USB camera? To figure out all of these things one has to learn about udev. But once udev is known, why would I need to use InputClass?

One more thing. udev+InputDevice configuration would work both for Xorg 1.7 and Xorg 1.9. So nobody would have to switch to .fdi and then back to xorg.conf. And I'm pretty sure, that semantics of InputClass will change again, and then configuration will have to be adjusted again.

I hate the idea of central configuration place. Sounds like Windows registry to me. There are different levels in the system and each one uses something provided by the lower level. So it is natural to configure things on different levels. All one needs is the clear pointers to where and what is configured.

Still, I don't mind if someone wants to configure things through InputClass. I just wanted to point out, that things can be configured without it.
Back to top
View user's profile Send private message
Rhiakath
Guru
Guru


Joined: 10 Feb 2006
Posts: 572
Location: Hell...

PostPosted: Wed Jan 19, 2011 10:22 am    Post subject: Reply with quote

I meant unification, not windows registry. And by unification, I don't mean a single file, or something. Just a common syntax. that's all. a standard
_________________
pc-rhiakath ~ $ emerge -s happiness
Searching..
[ Results for search key : happiness ]
[ Applications found : 0 ]

-------------------------------------------

I see dead pixels...
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2664
Location: Slovenia

PostPosted: Wed Jan 19, 2011 11:33 am    Post subject: Reply with quote

v_andal wrote:
Well. One has to learn how to configure udev anyway.

I didn't. No need to. All I ever learned was xorg.conf, then I had to learn the hal fdi stuff, now it's back to xorg.conf. If you mean outside of X, I never had to configure anything udev related either.

Centralization of configurations would certainly be nice. But the reality is, development is not central. There are several groups, each working in their own area. And some groups may want something more flexible than simple conf files. And then there's a lot of legacy cruft. So the most ideal (but far from perfect) scenario is each group provides good documentation.
Back to top
View user's profile Send private message
slackline
Veteran
Veteran


Joined: 01 Apr 2005
Posts: 1423
Location: /uk/sheffield

PostPosted: Thu Jan 20, 2011 8:07 am    Post subject: Reply with quote

Just hit this problem and tried re-defining InputDevice to InputClass only to be told there was an undefined reference to InputDevice.

Original /etc/X11/xorg.conf

Code:

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice     "Keyboard0" "CoreKeyboard"
    InputDevice     "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    Identifier     "Mouse0"
    Driver         "evdev"
    Driver         "vboxmouse"
    Option         "Protocol"
    Option         "Device" "/dev/input/mice"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    Identifier     "Keyboard0"
    Driver         "evdev"
    Option       "XkbModel" "evdev"
    Option       "XkbLayout" "gb"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "nVidia GeForce 9500 GT"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "G96 [GeForce 9500 GT]"
    BusID          "PCI:1:0:0"
    Option         "AddARGBGLXVisuals" "True"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
   Modes "1280x1024" "1024x768" "800x600" "640x480"
    EndSubSection
EndSection

Section "Extensions"
    Option         "Composite" "Enable"
EndSection


I tried changing these two section to InputClass...

Code:

Section "InputClass"
    Identifier     "Mouse0"
    Driver         "evdev"
    Driver         "vboxmouse"
    Option         "Protocol"
    Option         "Device" "/dev/input/mice"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputClass"
    Identifier     "Keyboard0"
    Driver         "evdev"
    Option       "XkbModel" "evdev"
    Option       "XkbLayout" "gb"
EndSection


..only to be told that there was an undefined reference to InputDevice, and indeed there is in the ServerLayout...

Code:

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice     "Keyboard0" "CoreKeyboard"
    InputDevice     "Mouse0" "CorePointer"
EndSection


..I thought it would be as simple as changing these references to InputClass too...

Code:

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputClass     "Keyboard0" "CoreKeyboard"
    InputClass     "Mouse0" "CorePointer"
EndSection



There is no mention in the xorg-server-1.8 upgrade guide as to what to do. Am I meant to have both InputDevice and InputClass defined for mouse and keyboard?
_________________
"Science is what we understand well enough to explain to a computer.  Art is everything else we do." - Donald Knuth
Back to top
View user's profile Send private message
v_andal
Guru
Guru


Joined: 26 Aug 2008
Posts: 523
Location: Germany

PostPosted: Thu Jan 20, 2011 8:44 am    Post subject: Reply with quote

slack---line wrote:
Just hit this problem and tried re-defining InputDevice to InputClass only to be told there was an undefined reference to InputDevice.
...
There is no mention in the xorg-server-1.8 upgrade guide as to what to do. Am I meant to have both InputDevice and InputClass defined for mouse and keyboard?


Well. No. Basically, InputClass is introduced as a way to find which device is your mouse and which is your keyboard etc. As long as your InputDevice section has correct

Option "Device" "/dev/file"

you don't need to bother with InputClass. Just make sure that you have

Section "ServerFlags"
Option "AutoAddDevices" "off"
Option "AutoEnableDevices" "on"
EndSection

And of course make sure that Option "Device" points to correct file.
Back to top
View user's profile Send private message
v_andal
Guru
Guru


Joined: 26 Aug 2008
Posts: 523
Location: Germany

PostPosted: Thu Jan 20, 2011 8:53 am    Post subject: Reply with quote

Gusar wrote:
v_andal wrote:
Well. One has to learn how to configure udev anyway.

I didn't. No need to.


You are lucky then. I had to, because otherwise I couldn't create working xorg.conf even using InputClass sections. I got InputClass working only after I've understood how udev works. Then I got rid of InputClass, and fixed few other long-outstanding things related to device files (like creating /dev/dvd symbolic link and fixing the interface names for my 2 network cards) :) YMMV.
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2664
Location: Slovenia

PostPosted: Thu Jan 20, 2011 9:02 am    Post subject: Reply with quote

@slack---line: Remove the ServerLayout section. And your InputClass sections are missing match rules.
Back to top
View user's profile Send private message
slackline
Veteran
Veteran


Joined: 01 Apr 2005
Posts: 1423
Location: /uk/sheffield

PostPosted: Thu Jan 20, 2011 9:36 am    Post subject: Reply with quote

@v_andal & @Gusar : Thanks for the pointers, will try this out this evening when back on my home computer, cheers.
_________________
"Science is what we understand well enough to explain to a computer.  Art is everything else we do." - Donald Knuth
Back to top
View user's profile Send private message
v_andal
Guru
Guru


Joined: 26 Aug 2008
Posts: 523
Location: Germany

PostPosted: Thu Jan 20, 2011 11:25 am    Post subject: Reply with quote

slack---line wrote:
@v_andal & @Gusar : Thanks for the pointers, will try this out this evening when back on my home computer, cheers.


If something goes wrong, then please provide the /var/log/Xorg.0.log
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum