Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Desktop Environments
  • Search

xorg hal and multiple keyboard maps [SOLVED]

Problems with GUI applications? Questions about X, KDE, Gnome, Fluxbox, etc.? Come on in. NOTE: For multimedia, go up one forum
Post Reply
Advanced search
6 posts • Page 1 of 1
Author
Message
javeree
Guru
Guru
Posts: 465
Joined: Sun Jan 29, 2006 5:17 pm

xorg hal and multiple keyboard maps [SOLVED]

  • Quote

Post by javeree » Sun May 24, 2009 5:59 pm

I have xorg working with hal and PS2 azerty keyboard. fyi, /etc/hal/fdi/policy/10-keymap.fdi contains
<?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">be</merge>
<merge key="input.xkb.variant" type="string" />
</match>
</device>
</deviceinfo>
I now received a wireless qwerty keyboard. I would like to have both azerty keyboards and qwerty keyboards attached to the same PC. I think I should somehow write a second 10-keymap-qwerty.fdi, but I am not sure
1. How to distinguish between the azerty keyboards (I have multiple, both PS2 and USB) and the qwerty keyboard. Preferably I would have a specific rule for the qwerty keyboard based opon its hal info:
udi = '/org/freedesktop/Hal/devices/usb_device_4d9_22_noserial_if2_logicaldev_in
put'
info.addons.singleton = {'hald-addon-input'} (string list)
info.capabilities = {'input', 'input.keys', 'button'} (string list)
info.category = 'input' (string)
info.parent = '/org/freedesktop/Hal/devices/usb_device_4d9_22_noserial_if2' (
string)
info.product = 'Device USB Device' (string)
info.subsystem = 'input' (string)
info.udi = '/org/freedesktop/Hal/devices/usb_device_4d9_22_noserial_if2_logicaldev_input' (string)
input.device = '/dev/input/event7' (string)
input.originating_device = '/org/freedesktop/Hal/devices/usb_device_4d9_22_noserial_if2' (string)
input.product = 'Device USB Device' (string)
input.x11_driver = 'evdev' (string)
input.xkb.layout = 'be' (string)
input.xkb.model = 'evdev' (string)
input.xkb.rules = 'base' (string)
input.xkb.variant = '' (string)
linux.device_file = '/dev/input/event7' (string)
linux.hotplug_type = 2 (0x2) (int)
linux.subsystem = 'input' (string)
linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:07.2/usb1/1-1/1-1:1.2/input/input7/event7' (string)
probably something like
<match key="info.udi" equals="/org/freedesktop/Hal/devices/usb_device_4d9_22_noserial_if2_logicaldev_input">
is needed, but I am not sure how to give priority between this match and the generl match on info.capabilities.
Second, can I trust that this udi remains unique (even e.g. when moving to a different pc) ?

Did anyone already try a similar thing ?
Last edited by javeree on Wed Jun 03, 2009 7:35 am, edited 1 time in total.
Top
d2_racing
Bodhisattva
Bodhisattva
User avatar
Posts: 13047
Joined: Mon Apr 25, 2005 2:25 pm
Location: Ste-Foy,Canada
Contact:
Contact d2_racing
Website

  • Quote

Post by d2_racing » Mon May 25, 2009 12:22 am

Hi, you shoulddouble check this thread : http://forums.gentoo.org/viewtopic-t-722498.html

I think that someone is using 2 keyboards layout at the same time.
Top
javeree
Guru
Guru
Posts: 465
Joined: Sun Jan 29, 2006 5:17 pm

  • Quote

Post by javeree » Wed Jun 03, 2009 7:34 am

The mentioned thread gave a lot of information, but none matching my specific question (actually: one person asking - no specific answer). It turned out quite easy after all. I just needed two files in /etc/hal/fdi/policy/

10-x11-input.fdi

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->
<!-- default configuration for keyboards = belgian azerty keyboard -->
<deviceinfo version="0.2">
  <device>
    <match key="info.capabilities" contains="input.keys">
      <merge key="input.x11_options.XkbRules" type="string">base</merge>

      <!-- If we're using Linux, we use evdev by default (falling back to kbd otherwise). -->
      <merge key="input.x11_driver" type="string">kbd</merge>
      <merge key="input.x11_options.XkbModel" type="string">pc105</merge>

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

      <merge key="input.x11_options.XkbLayout" type="string">be</merge>
      <merge key="input.x11_options.XkbVariant" type="string" />
    </match>
  </device>
</deviceinfo>
The above file makes sure that the 'standard' keyboard is set to belgian azerty (as most of my keyboards are)

and 20-x11-input-Brando.fdi

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->
<!-- Brando 78-keys 2.4GHz mini office keyboard -->
<!-- only deviations from the standard keyboards are defined -->
<!-- This file has to come AFTER the default keyboard configuration -->

<deviceinfo version="0.2">
  <device>
        <!-- only specify the keys that deviate from the default (be) keyboard -->
        <match key="info.udi" contains="usb_device_4d9_22_noserial">
              <merge key="input.x11_options.XkbLayout" type="string">us</merge>
              <merge key="input.x11_options.XkbVariant" type="string" />
        </match>
  </device>
</deviceinfo>
The above is specific for just one keyboard, and from my experiment it looks like later hal definitions override earlier definitions, therefore the naming of the file is important.

I could get the info.udi key by running lshal with the keyboard plugged in, and it seems the key is unique even when going with the keyboard to another computer.

I would need one match entry to identify each non-Belgian keyboard.

The solution could also be done in a single file if the more specific match (the querty keyboard) would come after the standard match (belgian keyboards).
Top
d2_racing
Bodhisattva
Bodhisattva
User avatar
Posts: 13047
Joined: Mon Apr 25, 2005 2:25 pm
Location: Ste-Foy,Canada
Contact:
Contact d2_racing
Website

  • Quote

Post by d2_racing » Wed Jun 03, 2009 11:06 am

Did you try this version ?

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- --> 
<!-- default configuration for keyboards = belgian azerty keyboard --> 
<deviceinfo version="0.2"> 
  <device> 
    <match key="info.capabilities" contains="input.keys"> 
      <merge key="input.x11_options.XkbRules" type="string">base</merge> 

      <!-- If we're using Linux, we use evdev by default (falling back to kbd otherwise). --> 
      <merge key="input.x11_driver" type="string">kbd</merge> 
      <merge key="input.x11_options.XkbModel" type="string">pc105</merge> 

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

      <merge key="input.x11_options.XkbLayout" type="string">be</merge> 
      <merge key="input.x11_options.XkbVariant" type="string" /> 
    </match> 

<!-- only specify the keys that deviate from the default (be) keyboard --> 
     <match key="info.udi" contains="usb_device_4d9_22_noserial"> 
             <merge key="input.x11_options.XkbLayout" type="string">us</merge> 
             <merge key="input.x11_options.XkbVariant" type="string" /> 
      </match> 
  </device> 
</deviceinfo>
Top
d2_racing
Bodhisattva
Bodhisattva
User avatar
Posts: 13047
Joined: Mon Apr 25, 2005 2:25 pm
Location: Ste-Foy,Canada
Contact:
Contact d2_racing
Website

  • Quote

Post by d2_racing » Wed Jun 03, 2009 11:09 am

Also, you should post your solution here : http://forums.gentoo.org/viewtopic-t-722498.html

or at least point it out inside the thread.

I'm sure you are not the only one that wants to have 2 keyboards layouts.
Top
javeree
Guru
Guru
Posts: 465
Joined: Sun Jan 29, 2006 5:17 pm

  • Quote

Post by javeree » Thu Jun 04, 2009 8:34 am

I've posted the reference in the thread you gave.

I personally prefer a solution with multiple files, one per device or type of devices, but I guess that's up to personal preference. Your one file solution works just as well.
Top
Post Reply

6 posts • Page 1 of 1

Return to “Desktop Environments”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic