# Apple Wireless Keyboard X11 configuration issue

## kwisatz_haderais

See also: http://gentoo-wiki.com/HOWTO_Use_an_Apple_wireless%2C_Bluetooth_keyboard#X11

I've been following the above howto and also added some comments and additional information where I found it to be helpful or necessary.

I'm specifically pointing to the X11 section, as my keyboard worked better not configuring it in X11 (although no special keys are working of course).

However, configuring my keyboard as specified in the above howto section, gives me this:

```
(II) evdev brain: Rescanning devices (1).

(**) Option "SendCoreEvents"

(**) AppleKbd-00:0D:F0:2E:A8:B0: always reports core events

(II) AppleKbd-00:0D:F0:2E:A8:B0: Found 1 absolute axes.

(II) AppleKbd-00:0D:F0:2E:A8:B0: Configuring as pointer.

(II) AppleKbd-00:0D:F0:2E:A8:B0: Found 17 mouse buttons

(**) AppleKbd-00:0D:F0:2E:A8:B0: Configuring 1 absolute axes.

(II) AppleKbd-00:0D:F0:2E:A8:B0: Checking button DIGI_STYLUS (330)

(II) AppleKbd-00:0D:F0:2E:A8:B0: Checking bit 330

(EE) AppleKbd-00:0D:F0:2E:A8:B0: AbsoluteTouch: 'DIGI_Touch' does not exist.

(**) AppleKbd-00:0D:F0:2E:A8:B0: Configuring in Absolute mode.

(II) AppleKbd-00:0D:F0:2E:A8:B0: Configured 17 mouse buttons

(**) Option "XkbModel" "macintosh"

(**) Option "XkbLayout" "de"

(II) XINPUT: Adding extended input device "AppleKbd-00:0D:F0:2E:A8:B0" (type: KEYBOARD)

(II) XINPUT: Adding extended input device "evdev brain" (type: evdev brain)

(II) XINPUT: Adding extended input device "Keyboard0" (type: KEYBOARD)

(II) XINPUT: Adding extended input device "Mouse0" (type: MOUSE)

(**) AppleKbd-00:0D:F0:2E:A8:B0: 1 valuators.

(**) evdev_btn.c (166): Registering 17 buttons.

(II) AppleKbd-00:0D:F0:2E:A8:B0: Init

(--) Mouse0: PnP-detected protocol: "ExplorerPS/2"

(II) Mouse0: ps2EnableDataReporting: succeeded

(II) evdev brain: Rescanning devices (2).

(II) AppleKbd-00:0D:F0:2E:A8:B0: On
```

Now my arrow keys and others that were working before adding the device in my xorg.conf are not working anymore. I blame it on X11 thinking that it is a Pointer device. Ever seen a mouse with 26 letters on it?  :Wink: Last edited by kwisatz_haderais on Thu Mar 13, 2008 10:16 am; edited 1 time in total

----------

## kwisatz_haderais

Using the keyboard driver instead of the evdev driver seems to work for me

 *Quote:*   

> (**) Option "SendCoreEvents"
> 
> (**) AppleKbd: always reports core events
> 
> (**) Option "Protocol" "standard"
> ...

 

Though I don't know if that keeps me from having some special functionality... but at least my arrow keys are back working.

Still my <>| and °^ keys are swapped. Also in the console.

----------

## kwisatz_haderais

These might be relevant: 

https://forums.gentoo.org/viewtopic-t-641069.html

https://forums.gentoo.org/viewtopic-t-641870.html

Albeit they seem to be related to specific versions of hal, xorg-server and evdev which I'm not using.

Refering to the above, 2nd thread, I'm still using hal-0.5.9 xorg-server-1.3.0.0-r5 and evdev-1.1.5-r1.

I'll welcome having my InputDevice Sections rendered obsolete in xorg.conf... as long as the new system is working, i.e., there are all the required fdi policies.

----------

## simoo

 *kwisatz_haderais wrote:*   

> Now my arrow keys and others that were working before adding the device in my xorg.conf are not working anymore. I blame it on X11 thinking that it is a Pointer device. Ever seen a mouse with 26 letters on it? 

 

I wrote that wiki and edited it a bit today after finding out more about evdev. I don't think X11 configuration is quirky, just X11 and evdev miss understood.  I may be able to help you further though, with regard to your arrow keys not working, are you using KDE?

Make sure you follow the KDE guide if you are. 

Make sure to load X11 on it's own and see how your keys behave before blaming X11.

Your X11 log finds your keyboard and registers it as a keyboard not a mouse:

"XINPUT: Adding extended input device "AppleKbd-00:0D:F0:2E:A8:B0" (type: KEYBOARD)"

Don't worry about the configured mouse buttons, my X11 log has them and my keyboard is fine

----------

## kwisatz_haderais

Well, first of all, thanks a lot for the howto!

You're right about the keyboard being recognized as a keyboard, I just didn't see that line... mea culpa.

I'm using xfce, but I haven't got any fancy key configuration and it's using the default xorg.conf InputDevices configuration.

I'll have a look at this again on tuesday, after my exam.

----------

## simoo

Cool no problem, I'm glad it was useful. Best of luck with the exam  :Smile: 

I am subscribed to this topic so post up if you have problems and I'll see if I can help as I have the keyboard working fine under Xfce and KDE

----------

## kwisatz_haderais

Well, I'm either a fast learner or really bad at concentrating on my studies...  :Smile: 

I reset my driver to evdev. All that differs from your setup is 

a) the XkbLayout, because this is a german layout and 

b) that I've used the Name instead of the event device (having several peripherals making the number subject to change often)

As I mentioned in one of my previous posts, I have no fancy keyboard configuration in Xfce whatsoever.

I have also just today discovered xfkc and after experimenting with no result other than screwing up my builtin keyboards layout, left it to "Use X configuration"

Result:

the right alt button is interpreted as carriage return,

and as a result I can't access any symbols on alt gr (@,€,etc...)

the arrows don't work at all

^° and <> are still mixed up

Now, I've read the thread about HAL and evdev-1.2, but as my versions should still use the xorg.conf configuration, I guess it can't be related to any fdi profiles, can it?

----------

## kwisatz_haderais

I tried the keyboard in a bare xinit environment and got the same results. But I also got some promising error messages, which, as it seems, I can't get to redirect their output into a file.

Basically it tells me that some keymaps are duplicate entries or similar.

I'll try to somehow get the output into a file.

----------

## kwisatz_haderais

OK, should be these:

```
Warning:          Multiple names for keycode 182

                  Using <FK13>, ignoring <K5D>

Warning:          Key name <FK13> assigned to multiple keys

                  Using 182, ignoring 118

Warning:          Multiple names for keycode 183

                  Using <FK14>, ignoring <K5E>

Warning:          Key name <FK14> assigned to multiple keys

                  Using 183, ignoring 119

Warning:          Multiple names for keycode 184

                  Using <FK15>, ignoring <K5F>

Warning:          Key name <FK15> assigned to multiple keys

                  Using 184, ignoring 120

Warning:          Multiple names for keycode 157

                  Using <KPEQ>, ignoring <K59>

Warning:          Key name <KPEQ> assigned to multiple keys

                  Using 157, ignoring 126
```

Now I do have some keycodes in my Xmodmap:

```

! DisplayBrightness

keycode 247 = XF86BrightnessAdjust

keycode 248 = XF86BrightnessAdjust

! Volume Keys

keycode 174 = XF86AudioLowerVolume

keycode 176 = XF86AudioRaiseVolume

keycode 160 = XF86AudioMute

! special keys

keycode 236 = XF86Mail

keycode 178 = XF86WWW

keycode 242 = XF86Search

keycode 222 = XF86PowerDown

keycode 223 = XF86Sleep
```

But they're not the same.

Could the macintosh keycodes be conflicting with my standard pc105 notebook keymap?

And if that's not the issue, where to look next?

----------

## kwisatz_haderais

Ok, next thing I did was disabling my builtin keyboard alltogether in my xorg.conf.

The arrow keys are working, but now I have a US layout  :Smile: 

Though it still says  *Quote:*   

> (**) Option "XkbLayout" "de"

  in my Xorg.0.log

----------

## kwisatz_haderais

Giving up for today... back to my studies...  :Sad: 

----------

## simoo

I'm a bit pushed for time this morning so I'll give you my xorg.conf:

```

Section "ServerLayout"

   Identifier      "X.org Configured"

   Screen      0   "Screen0"          0 0

   InputDevice      "Logitech USB Gaming Mouse"   "CorePointer" # "SendCoreEvents"

   #InputDevice      "Mouse0"         "CorePointer"

   InputDevice      "Apple Inc. Keyboard"      "SendCoreEvents"   

   #InputDevice      "Keyboard0"         "CoreKeyboard"

EndSection

Section "Files"

   FontPath     "/usr/share/fonts/misc:unscaled"

   FontPath     "/usr/share/fonts/Type1"

   FontPath     "/usr/share/fonts/TTF"

   FontPath     "/usr/share/fonts/corefonts"

   FontPath     "/usr/share/fonts/freefonts"

   FontPath     "/usr/share/fonts/sharefonts"

   FontPath     "/usr/share/fonts/terminus"

   FontPath     "/usr/share/fonts/ttf-bitstream-vera"

   FontPath     "/usr/share/fonts/unifont"

   FontPath     "/usr/share/fonts/local"

   FontPath     "/usr/share/fonts/cyrillic

   FontPath     "/usr/share/fonts/75dpi:unscaled"

        FontPath     "/usr/share/fonts/100dpi:unscaled"

   FontPath     "/usr/share/fonts/artwiz"

   FontPath     "/usr/share/fonts/OTF"

EndSection

Section "Module"

   Load  "extmod"

   Load  "dbe"

   Load  "record"

   Load  "glx"

   Load  "GLcore"

   Load  "xtrap"

   #Load  "dri"

   Load  "type1"

   Load  "freetype"

EndSection

Section "ServerFlags"

   Option      "blank time"   "10"

   Option      "standby time"   "20"

   Option      "suspend time"   "20"

   Option      "off time"   "20"

EndSection

Section "InputDevice"

        Identifier      "Apple Inc. Keyboard"

   Driver          "evdev"

   #Option          "Device"           "/dev/input/event7"      # (cat /proc/bus/input/devices)

   Option          "Name"             "Apple Inc. Keyboard"      # (cat /proc/bus/input/devices)

   Option      "Phys"         "00:0A:3A:51:50:7B"      # (cat /proc/bus/input/devices)

   Option       "XkbRules"      "xorg"

         Option          "XkbModel"         "macintosh"

   #Option     "XkbModel"        "evdev" 

        Option          "XkbLayout"        "gb"

   Option       "XkbVariant"      "mac"

EndSection

#Section "InputDevice"

#   Identifier   "keyboard0"

#   Driver      "evdev"

#   Option      "Device"      "/dev/input/event0"

#   Option      "AutoRepeat"      "500 5"

#   Option      "XkbModel"      "pc105"

#   Option      "XkbLayout"      "gb"

#EndSection   

#Section "InputDevice"

#   Identifier   "Mouse0"

#   Driver      "mouse"

#   Option      "Protocol"   "PS/2"

#   Option      "Device"   "/dev/input/mice"

#EndSection

Section "InputDevice"

   Identifier     "Logitech USB Gaming Mouse"

   Driver         "evdev"

   #Option          "Device"           "/dev/input/event1"      # (cat /proc/bus/input/devices)

   Option      "Name"                  "Logitech USB Gaming Mouse"   # (cat /proc/bus/input/devices)

   Option      "Phys"         "usb-0000:00:10.0-2/input0"   # (cat /proc/bus/input/devices)

EndSection

Section "Monitor"

   Identifier   "Monitor0"

   VendorName   "Samsung"

   ModelName   "SyncMaster 226BW"

   #DisplaySize   474 303         # Actual size (22"), dot pitch 0.282 mm, res. 1680x1050.

   #DisplaySize   427 267         # 100x100 DPI

   DisplaySize   445 278         # 96x96 DPI

   #DisplaySize   474.1 296.3      # 90x90 DPI

   HorizSync   30 - 81

   VertRefresh   56 - 75

EndSection

Section "Device"

   Identifier     "Card0"

   Driver         "nvidia"

   VendorName     "nVidia Corporation"

   BoardName      "NV40 [GeForce 6800 GT]"

   BusID          "PCI:1:0:0"

   Option      "UseEdidDpi"      "False"

   Option      "DPI"         "96 x 96"

   Option      "RenderAccel"      "True"

   Option      "AddARGBGLXVisuals"   "True"

   Option      "UseEvents"      "False"

   Option      "NoLogo"      "True"

   Option       "DPMS"          "True"

   Option      "CoolBits"      "1"

   #Option         "NVAGP"                 "1"

EndSection

Section "Extensions"

        Option     "Composite"    "Enable"

EndSection

Section "Screen"

   Identifier "Screen0"

   Device     "Card0"

   Monitor    "Monitor0"

   DefaultDepth 24

   SubSection "Display"

      Viewport   0 0

      Depth     24

   EndSubSection

EndSection

```

and a link to Evdev's manual:

http://linux.die.net/man/4/evdev

see if that helps, i'll have a proper look later.

----------

## kwisatz_haderais

Thanks for your xorg.conf, but it won't help. I'm not on my notebook but I can tell without trying  :Wink: 

Like I said, commenting out my regular keyboard (which isn't really what I'm keen on) and using but the Apple one, gives me exactly what you have there. A "gb" layout. Maybe there simply isn't any macintosh keymap for german layouts yet... who knows...

I've tried to do the magic with fdi policies, albeit to no avail.

Guess I'm just gonna leave the whole keyboard out of my xorg.conf for a while and see if there are any changes with kernel 2.6.25 and the next versions of evdev, xorg-server and hald.

Thanks a lot anyway!

----------

## simoo

sorry things aren't working out for you. You can see what layouts are available in '/usr/share/X11/xkb/rules/xorg.lst'

I checked mine and as far as I can see this *should work for you:

[code]

...

Option          "XkbModel"      	"macintosh"

Option          "XkbLayout"     	"gb"

Option 		"XkbVariant"		"mac"

...

[code/]

in my xorg.lst there is a 'de' mac variant as well as a 'gb' one.

----------

## kwisatz_haderais

Yeah, I'm seeing it, but it won't work  :Sad: 

The question is who or what to blame?

evdev, xorg, hal, bluez, the kernel, or did I do something wrong?

Putting it all together in a short paragraph:

[case 1] no configuration in xorg.conf or configuration using kbd: same german layout as my builtin keyboard, only with ^° and <> swapped

[case 2] using evdev and SendCoreEvents: german layout with ^° and <> swapped, right alt working as e carriage return, no alt gr functionality, arrow keys not working

[case 3] using evdev and CoreKeyboard: gb layout (regardless of XkbLayout "de") and ^° and <> still swapped.Last edited by kwisatz_haderais on Wed Mar 05, 2008 9:03 am; edited 1 time in total

----------

## simoo

1. Just for reference what version:

Kernel

x11-base/xorg-server

x11-base/xorg-x11

x11-drivers/xf86-input-keyboard

x11-drivers/xf86-input-mouse

x11-drivers/xf86-input-evdev

sys-apps/hal & app-misc/hal-info

net-wireless/bluez-libs & net-wireless/bluez-utils

and have you tried re-emerging all those packages (except the kernel).

2. How does the keyboard behave before X11 is running - from your desktop 'ctrl+alt+F1' eg. If I log on after that my keyboard behaves as if it is a standard 'gb' one. Do the arrow keys work then?

----------

## kwisatz_haderais

 *simoo wrote:*   

> 1. Just for reference what version:

 

gentoo-sources-2.6.24-r2

x11-base/xorg-server-1.3.0.0-5

x11-base/xorg-x11-7.2

x11-drivers/xf86-input-keyboard-1.1.1

x11-drivers/xf86-input-mouse-1.2.3

x11-drivers/xf86-input-evdev-1.1.5-r1

sys-apps/hal-0.5.9.1-r3

app-misc/hal-info-20070618

net-wireless/bluez-libs-2.25

net-wireless/bluez-utils-2.25-r1

I don't know if I'm so keen on upgrading to xorg-server-1.4... having read one of the above threads..  :Sad: 

 *simoo wrote:*   

> 
> 
> and have you tried re-emerging all those packages (except the kernel).

 

nope, I haven't. Except for the kernel  :Wink:  No, seriously, I didn't have the xorg-x11 meta package installed, since nothing seemed to depend on it. (I like my notebook as leightweight as possible) but I'm compiling it as we s.. write.

 *simoo wrote:*   

> 2. How does the keyboard behave before X11 is running - from your desktop 'ctrl+alt+F1' eg. If I log on after that my keyboard behaves as if it is a standard 'gb' one. Do the arrow keys work then?

 

Mine behaves exactly as described in the above case 1. I guess the strokes are simply interpreted as specified in my /etc/conf.d/keymap, as a normal de-latin1 layout. Except for the two keys (also described above) which are always swapped as it seems.

And hey, thanks for your not giving up in helping me!  :Wink:  Highly appreciated.

----------

## kwisatz_haderais

bump

nobody else have a clue?

or an issue for that matter?  :Wink: 

----------

## twam

Have a look here: https://forums.gentoo.org/viewtopic-t-664760-highlight-apple.html

----------

## kwisatz_haderais

Guess I'll just wait for kernel 2.6.25 then... or for an idle and dull moment.

----------

