Hal and internet keyboards

John Woods johnrw at gmail.com
Wed Aug 1 12:04:35 PDT 2007


On 8/1/07, John Woods <johnrw at gmail.com> wrote:
> Hi all,
>
> I see I can specify some keyboard functions in the fdi like volumeup,
> search, homepage, www, etc... but others don't get mapped correctly in
> my setup.
>
> eject-cd close-cd and function keys like f19 through f24... and the
> cut, copy, paste don't map either. Keystrokes are assinged but not to
> valid keys that X identifies as useful.
>
> Where do I look for working names? These names are all lowercase...
> and yet they do get mapped to the correct functions... I got these
> names from addons-input.c.
>
> regards,
> John Woods
>

Ok... so I should have read some more... I seem to have found the
needed information here:
http://people.freedesktop.org/~david/hal-spec/hal-spec.html#device-properties-input-keymap

Well if I was the crying type, I would have tears of great joy right now...
Using nothing but Hal, and a setup x keyboard configuration for my keyboard...
where the enhanced function keys (with a mode key) are given keycodes
starting from 212
ordinarily by using...
setkeycodes e03b 212 e03c 213 e03d 214 e03e 215 e03f 216 e040 217
setkeycodes e041 218 e042 219 e043 220 e044 221 e057 222 e058 223

and then specifying those keycodes in a configuration file for the
keyboard in X,
don't ask me why but 212 through 223 are not consecutive...

/etc/X11/xkb/symbols/inet

key <I3B>   {       [ XF86Support
key <FK13>  {       [ XF86Word
key <FK14>  {       [ XF86Excel
key <FK15>  {       [ XF86Pictures
key <FK16>  {       [ Undo
key <I65>   {       [ Redo
key <I42>   {       [ Print
key <I43>   {       [ XF86Save
key <I44>   {       [ XF86Launch1
key <I45>   {       [ XF86Launch2
key <I14>   {       [ XF86Launch3
key <I4A>   {       [ XF86Launch4

and adjusting these files to contain the tagname for the new keyboard
def. I chose
as I did in bug 11686 logiex110
/etc/X11/xkb/rules/base.xml
/etc/X11/xkb/rules/base.lst
/etc/X11/xkb/rules/base

and now the last thing I did was to specify those keycodes directly
from kernel's input.h
in the fdi. Notice I specified my motherboard model and the oem "ECS".
Notice also that the symbol names used from input.h have nothing to do
with the symbol name used in X.
X picks them up and assigns the name specified in the keyboard config.
Eg.. XF86Word, XF86Excel etc...

So... with just a keyboard config file, and an fdi that corresponds to that
keyboard model... keys which were previously unknown to the atkbd.c
driver and the
kernel, were mapped without any more fuss. Here is the file I used to
get keycodes
212 ~ 223.

    <!-- These are raw scancodes produced by the atkbd driver -->
    <match key="@input.originating_device:info.linux.driver" string="atkbd">
      <match key="/org/freedesktop/Hal/devices/computer:system.hardware.product"
contains="M825G">
        <match key="/org/freedesktop/Hal/devices/computer:system.hardware.vendor"
contains="ECS">
          <append key="input.keymap.data"
type="strlist">6d:homepage</append> 		<!-- Close -->
          <append key="input.keymap.data"
type="strlist">e03b:camera</append> 		<!-- F1 -->
          <append key="input.keymap.data"
type="strlist">e03c:sound</append>		<!-- F2 -->
          <append key="input.keymap.data"
type="strlist">e03d:question</append>		<!-- F3 -->
          <append key="input.keymap.data"
type="strlist">e03e:email</append>		<!-- F4 -->
          <append key="input.keymap.data"
type="strlist">e03f:chat</append>		<!-- F5 -->
          <append key="input.keymap.data"
type="strlist">e040:search</append>		<!-- F6 -->
          <append key="input.keymap.data"
type="strlist">e041:connect</append>		<!-- F7 -->
          <append key="input.keymap.data"
type="strlist">e042:finance</append>		<!-- F8 -->
          <append key="input.keymap.data"
type="strlist">e043:sport</append>		<!-- F9 -->
          <append key="input.keymap.data"
type="strlist">e044:shop</append>		<!-- F10 -->
          <append key="input.keymap.data"
type="strlist">e057:alterase</append>		<!-- F11 -->
          <append key="input.keymap.data"
type="strlist">e058:cancel</append>		<!-- F12 -->
          <append key="info.capabilities" type="strlist">input.keymap</append>
        </match>
      </match>
    </match>

I noticed you called HAL 0.5.9 "Precipice", and 0.5.10 had no name...
yet. Well my congrats to you all. Looks like hal is a must have. I had
fun getting this all to work.

regards,
John Woods


More information about the hal mailing list