Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Apple Wireless Keyboard fn (delete, page up, etc) (*SOLVED*)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
OrangeToque
n00b
n00b


Joined: 03 Apr 2006
Posts: 57
Location: Edmonton, Alberta, Canada

PostPosted: Wed Feb 20, 2008 4:42 pm    Post subject: Apple Wireless Keyboard fn (delete, page up, etc) (*SOLVED*) Reply with quote

I just got a new Apple Wireless Keyboard (Bluetooth)

Basic keyboard functionality is there, however, the keyboard fn key is not recognized and as such combo keys such as delete, page up, and page down are not functioning, neither are the volume up/down/mute and multimedia keys.

Any ideas for how to get the keys to function?


Thanks
_________________
OS: Linux 2.6.24-gentoo-r3 x86_64 Gentoo v1.12.11.1 Sound: HDA Intel
CPU: Intel(R) Core(TM)2 Quad CPU Q6700 @ 2.66GHz GenuineIntel
Disk: 2x 300GB 7200.10 SATA II Video: GeForce 7900 GT RAM: 4GB


Last edited by OrangeToque on Fri Feb 22, 2008 4:55 pm; edited 1 time in total
Back to top
View user's profile Send private message
twam
Apprentice
Apprentice


Joined: 15 Feb 2005
Posts: 189
Location: Ammerbuch, Germany

PostPosted: Thu Feb 21, 2008 12:09 pm    Post subject: Reply with quote

Support for the new wireless keyboard was added in kernel 2.6.25-rc2.

If you want to get it working without waiting, you must change some vendor ids in the kernel source files. Look here for further information.
Back to top
View user's profile Send private message
OrangeToque
n00b
n00b


Joined: 03 Apr 2006
Posts: 57
Location: Edmonton, Alberta, Canada

PostPosted: Thu Feb 21, 2008 3:21 pm    Post subject: Reply with quote

I've tried the lastest git-sources, and the keys were not recognized.

I've also tried changing the vendor ids to no avail.

Any other thoughts/suggestions ?

Where can/should I post a bug about support inside the kernel?
_________________
OS: Linux 2.6.24-gentoo-r3 x86_64 Gentoo v1.12.11.1 Sound: HDA Intel
CPU: Intel(R) Core(TM)2 Quad CPU Q6700 @ 2.66GHz GenuineIntel
Disk: 2x 300GB 7200.10 SATA II Video: GeForce 7900 GT RAM: 4GB
Back to top
View user's profile Send private message
twam
Apprentice
Apprentice


Joined: 15 Feb 2005
Posts: 189
Location: Ammerbuch, Germany

PostPosted: Thu Feb 21, 2008 6:43 pm    Post subject: Reply with quote

In drivers/hid/usbhid/hid-quirks.c you should find
Code:
#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI  0x022c
#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO   0x022d
#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS   0x022e

in kernels >2.6.25-rc2. This product ids should be the same as lsusb reports, e.g. 0x0221 for me:
Code:
Bus 002 Device 004: ID 05ac:0221 Apple Computer, Inc.


To enable Apple fn features, you must set
Code:
CONFIG_USB_HIDINPUT_POWERBOOK=y

in your kernel config.
Back to top
View user's profile Send private message
OrangeToque
n00b
n00b


Joined: 03 Apr 2006
Posts: 57
Location: Edmonton, Alberta, Canada

PostPosted: Fri Feb 22, 2008 1:05 am    Post subject: Reply with quote

Tried that several times, no luck.

The keyboard is bluetooth ... could that affect the way the keypresses are processed?

lsusb does not reveal anything regarding the keyboard,

hidd --show (on the other hand reveals :: )

xx:xx:xx:xx:xx:xx Apple Inc. Keyboard [05ac:022c] connected

basically providing me with the device id of 0x022c which was hardcoded into the hid-quirks.c in the latest git-source (linux-2.6.25-rc2-git4)

Re-compiled that kernel (with the Apple keyboard option) and still no luck.
_________________
OS: Linux 2.6.24-gentoo-r3 x86_64 Gentoo v1.12.11.1 Sound: HDA Intel
CPU: Intel(R) Core(TM)2 Quad CPU Q6700 @ 2.66GHz GenuineIntel
Disk: 2x 300GB 7200.10 SATA II Video: GeForce 7900 GT RAM: 4GB
Back to top
View user's profile Send private message
twam
Apprentice
Apprentice


Joined: 15 Feb 2005
Posts: 189
Location: Ammerbuch, Germany

PostPosted: Fri Feb 22, 2008 1:22 pm    Post subject: Reply with quote

I think the problem is that this driver does not work for the bluetooth keyboards. Maybe you should report this and ask on linux-input@vger.kernel.org.
Back to top
View user's profile Send private message
OrangeToque
n00b
n00b


Joined: 03 Apr 2006
Posts: 57
Location: Edmonton, Alberta, Canada

PostPosted: Fri Feb 22, 2008 4:04 pm    Post subject: Reply with quote

I've found a big part of the answer here ::

http://www.unionofopposites.com/tech/applebtkb.shtml

Basically I needed to patch net/bluetooth/hidp/core.c ::

Code:

--- linux-2.6.24-gentoo-r2/net/bluetooth/hidp/core.c.orig       2007-10-26 10:28:59.000000000 -0700
+++ linux-2.6.24-gentoo-r2/net/bluetooth/hidp/core.c    2007-10-26 10:30:59.000000000 -0700
@@ -686,6 +686,7 @@
 } hidp_blacklist[] = {
        /* Apple wireless Mighty Mouse */
        { 0x05ac, 0x030c, HID_QUIRK_MIGHTYMOUSE | HID_QUIRK_INVERT_HWHEEL },
+       { 0x05ac, 0x022c, HID_QUIRK_POWERBOOK_HAS_FN },
 
        { }     /* Terminating entry */
 };



This has enabled basic functionality (Home / End / Delete / Pg up / Pg down)

Multimedia keys function with kernel 2.6.25 (git sources with the above patch [/code]@ this point) but I think I will be able to patch hid-quirks.c in 2.6.24 to get them to function.
_________________
OS: Linux 2.6.24-gentoo-r3 x86_64 Gentoo v1.12.11.1 Sound: HDA Intel
CPU: Intel(R) Core(TM)2 Quad CPU Q6700 @ 2.66GHz GenuineIntel
Disk: 2x 300GB 7200.10 SATA II Video: GeForce 7900 GT RAM: 4GB
Back to top
View user's profile Send private message
OrangeToque
n00b
n00b


Joined: 03 Apr 2006
Posts: 57
Location: Edmonton, Alberta, Canada

PostPosted: Fri Feb 22, 2008 4:14 pm    Post subject: Reply with quote

I did run into one problem, and thought I should share the fix ::

All of this works in X, but when I switch to a console, the keyboard doesn't work ? worked before @ the console, now it doesn't ( some keys are ignored, others produce numbers ... )


FIX :: removed numlock from startup

Code:
rc-update del numlock

_________________
OS: Linux 2.6.24-gentoo-r3 x86_64 Gentoo v1.12.11.1 Sound: HDA Intel
CPU: Intel(R) Core(TM)2 Quad CPU Q6700 @ 2.66GHz GenuineIntel
Disk: 2x 300GB 7200.10 SATA II Video: GeForce 7900 GT RAM: 4GB
Back to top
View user's profile Send private message
OrangeToque
n00b
n00b


Joined: 03 Apr 2006
Posts: 57
Location: Edmonton, Alberta, Canada

PostPosted: Fri Feb 22, 2008 4:54 pm    Post subject: Reply with quote

You can apply this patch to line up the multimedia keys across the top of the keyboard ::

Code:
--- linux-2.6.24-gentoo-r1/drivers/hid/hid-input.c   2008-01-24 15:58:37.000000000 -0700
+++ linux/drivers/hid/hid-input.c   2008-02-22 09:34:08.000000000 -0700
@@ -101,22 +101,24 @@
 #define POWERBOOK_FLAG_FKEY 0x01
 
 static struct hidinput_key_translation powerbook_fn_keys[] = {
-   { KEY_BACKSPACE, KEY_DELETE },
-   { KEY_F1,       KEY_BRIGHTNESSDOWN,     POWERBOOK_FLAG_FKEY },
-   { KEY_F2,       KEY_BRIGHTNESSUP,       POWERBOOK_FLAG_FKEY },
-   { KEY_F3,       KEY_MUTE,               POWERBOOK_FLAG_FKEY },
-   { KEY_F4,       KEY_VOLUMEDOWN,         POWERBOOK_FLAG_FKEY },
-   { KEY_F5,       KEY_VOLUMEUP,           POWERBOOK_FLAG_FKEY },
-   { KEY_F6,       KEY_NUMLOCK,            POWERBOOK_FLAG_FKEY },
-   { KEY_F7,       KEY_SWITCHVIDEOMODE,    POWERBOOK_FLAG_FKEY },
-   { KEY_F8,       KEY_KBDILLUMTOGGLE,     POWERBOOK_FLAG_FKEY },
-   { KEY_F9,       KEY_KBDILLUMDOWN,       POWERBOOK_FLAG_FKEY },
-   { KEY_F10,      KEY_KBDILLUMUP,         POWERBOOK_FLAG_FKEY },
-   { KEY_UP,       KEY_PAGEUP },
-   { KEY_DOWN,     KEY_PAGEDOWN },
-   { KEY_LEFT,     KEY_HOME },
-   { KEY_RIGHT,    KEY_END },
-   { }
+        { KEY_BACKSPACE, KEY_DELETE },
+        { KEY_F1,       KEY_BRIGHTNESSDOWN,     POWERBOOK_FLAG_FKEY },
+        { KEY_F2,       KEY_BRIGHTNESSUP,       POWERBOOK_FLAG_FKEY },
+        { KEY_F3,       KEY_CYCLEWINDOWS,       POWERBOOK_FLAG_FKEY }, /* Exposé */
+        { KEY_F4,       KEY_WWW,                POWERBOOK_FLAG_FKEY }, /* Dashboard */
+        { KEY_F5,       KEY_FN_F5 },
+        { KEY_F6,       KEY_FN_F6 },
+        { KEY_F7,       KEY_PREVIOUSSONG,       POWERBOOK_FLAG_FKEY },
+        { KEY_F8,       KEY_PLAYPAUSE,          POWERBOOK_FLAG_FKEY },
+        { KEY_F9,       KEY_NEXTSONG,           POWERBOOK_FLAG_FKEY },
+        { KEY_F10,      KEY_MUTE,               POWERBOOK_FLAG_FKEY },
+        { KEY_F11,      KEY_VOLUMEDOWN,         POWERBOOK_FLAG_FKEY },
+        { KEY_F12,      KEY_VOLUMEUP,           POWERBOOK_FLAG_FKEY },
+        { KEY_UP,       KEY_PAGEUP },
+        { KEY_DOWN,     KEY_PAGEDOWN },
+        { KEY_LEFT,     KEY_HOME },
+        { KEY_RIGHT,    KEY_END },
+        { }
 };
 
 static struct hidinput_key_translation powerbook_numlock_keys[] = {

_________________
OS: Linux 2.6.24-gentoo-r3 x86_64 Gentoo v1.12.11.1 Sound: HDA Intel
CPU: Intel(R) Core(TM)2 Quad CPU Q6700 @ 2.66GHz GenuineIntel
Disk: 2x 300GB 7200.10 SATA II Video: GeForce 7900 GT RAM: 4GB
Back to top
View user's profile Send private message
RobbaZ
n00b
n00b


Joined: 18 Nov 2004
Posts: 63

PostPosted: Sat Mar 08, 2008 6:45 pm    Post subject: Reply with quote

Hi! Maybe this isn't the best place to ask those infos.. I've the same keyboard but I've a lot of problem with bluetooth connection...
I've tried to follow this guide: http://gentoo-wiki.com/HOWTO_Use_an_Apple_wireless,_Bluetooth_keyboard but the keyboard is very unresponsive! (sometimes works so slow, sometimes doesn't work at all)

Pleeease.. Can you post me what version of bluez-* are you using and some guide-lines to have it working?

Thank you!
Back to top
View user's profile Send private message
OrangeToque
n00b
n00b


Joined: 03 Apr 2006
Posts: 57
Location: Edmonton, Alberta, Canada

PostPosted: Sun Mar 09, 2008 8:36 pm    Post subject: Reply with quote

Sure.

I'm using::

bluez-utils-3.27
bluez-libs-3.27

The most important part for me is that I am using the old-daemons use flag.

Then I'm using the hidd rc-script to handle the bluetooth connection and input with the keyboard.


Basically follow the directions in the gentoo wiki, except there is no need to add the HIDD_ENABLED=TRUE to your /etc/conf.d/bluetooth, instead, you should startup the HIDD service @ boot ::

Code:
rc-update add hidd default


My config file for hidd is a follows ::

/etc/conf.d/hidd#
Code:
Bluetooth hidd daemon configuraton file

# Arguments to hidd
HIDD_OPTIONS="--encrypt --connect xx:xx:xx:xx:xx:xx --server --master -t 0"


where xx:xx:xx:xx:xx:xx is the address of my keyboard.

In order to pair your device the first time, newer versions of bluez will require either bluez-gnome (which I used (version 0.23)) or kdebluetooth (which I haven't tried and can not verify)

I hope this helps.
_________________
OS: Linux 2.6.24-gentoo-r3 x86_64 Gentoo v1.12.11.1 Sound: HDA Intel
CPU: Intel(R) Core(TM)2 Quad CPU Q6700 @ 2.66GHz GenuineIntel
Disk: 2x 300GB 7200.10 SATA II Video: GeForce 7900 GT RAM: 4GB
Back to top
View user's profile Send private message
RobbaZ
n00b
n00b


Joined: 18 Nov 2004
Posts: 63

PostPosted: Wed Mar 12, 2008 7:56 pm    Post subject: Reply with quote

thank you so much!! Now I've got it working!! :)
I have only some problems with the FN-key (maybe I must patch my italian layout) but I can see the keycode (464) with "showkey" command..

Thank you!
Bye
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
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