Bug Description

The latest Apple Bluetooth Keyboards (purchased in Oct 2011) do not have a working Fn key in Ubuntu. This has been reported for the Australian sold keyboards (http://ubuntuforums.org/showthread.php?t=1855975). Not sure if it is also a problem in other countries.

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

I've tried to follow the instructions above. I suspect the bug is in the kernel, but when I search for "kernel" under packages I get an error saying "too many matches". When I refine the search to my specific kernel i get "no packages exist".

Also, I did some browsing in the kernel source on gitweb, and it appears the relevant definition has moved from net/bluetooth/hidp/core.c (kernel 2.6.14, as reported in bug #227501) to drivers/hid/hid-ids.h and drivers/hid/hid-apple.c in the linux source.

It seems like it would be simple to fix, but I don't know how / don't have time to learn how to prepare a kernel patch.

Would it be possible for you to test the latest upstream kernel? It will allow additional upstream developers to examine the issue. Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . If possible, please test the latest v3.2 kernel[1] (Not a kernel in the daily directory). Once you've tested the upstream kernel, please remove the 'needs-upstream-testing' tag(Only that one tag, please leave the other tags). This can be done by clicking on the yellow pencil icon next to the tag located at the bottom of the bug description and deleting the 'needs-upstream-testing' text.

If this bug is fixed by the mainline kernel, please add the following tag 'kernel-fixed-upstream-KERNEL-VERSION'. For example, if kernel version 3.2-rc1 fixed the issue, the tag would be: 'kernel-fixed-upstream-v3.2-rc1'.

If the mainline kernel does not fix this bug, please add the tag: 'kernel-bug-exists-upstream'.

If you are unable to test the mainline kernel, for example it will not boot, please add the tag: 'kernel-unable-to-test-upstream'. If you believe this bug does not require upstream testing, please add the tag: 'kernel-upstream-testing-not-needed'.

Once testing of the upstream kernel is complete, please mark this bug as "Confirmed".

Here's what I did to find it: Go to http://kernel.org. On the line by "stable: 3.0.18", click "Gitweb". Click "tree" at the top of the page, then browse to drivers/hid/hid-ids.h; the device ID is visible. For comparison:
$ cat /proc/version_signature
Ubuntu 3.0.0-15.26-generic 3.0.13

So I guess it was introduced sometime between kernel version 3.0.14 and 3.0.18 inclusive. But I have no idea how/on what schedule the Ubuntu kernel for 11.10 is updated from the one on kernel.org.

Since this is a simple fix, only a few lines, I hope one of the Ubuntu devs could "cherry-pick" it, if they happen to look at this bug. Worst case: no one will, and the fix will come in the 3.2 kernel when Ubuntu 12.04 is released.

Bug #942184 is very similar to this one, but for a natty SRU. The suggested patch from the submitter (comment #1) includes the 0x0255, 0x0256 and 0x0257 device IDs, but the when the patch was applied (comment #4) only 0x0256 was added.

I see Precise is past Kernel freeze so I doubt anyone will fix this any time soon. After all, this bug has only been open for 4 months.. /rant.

The required patches are in the 3.3 stable kernel, not in 3.2.14 which Precise is using. I see lots of requests to just use the 3.3 kernel (largely for power enhancements) but if Ubuntu insists on sticking with 3.2, could we please get the following commits backported to 3.2?

This issue appears to be an upstream bug, since you tested the latest upstream kernel. Would it be possible for you to open an upstream bug report at bugzilla.kernel.org [1]? That will allow the upstream Developers to examine the issue, and may provide a quicker resolution to the bug.

If you are comfortable with opening a bug upstream, It would be great if you can report back the upstream bug number in this bug report. That will allow us to link this bug to the upstream report.

The problem as I stated above is that the commits have not been backported to the 3.2 kernel series. If you browse the stable tree at git.kernel.org you'll see the 3.3.4 [1] and 3.4-rc1 [2] tagged trees have the right commits. 3.2.16 still does not. This is probably the type of thing a Ubuntu kernel guy could get pushed through a lot faster than some random guy on the internet (me).

Well, it's a backporting problem if you are running vanilla Precise. The other part of the problem is that running Precise with a newer kernel that supposedly has the devices added doesn't help. I would be happy to file an upstream bug if someone can confirm that the device IDs are indeed included in recent mainline kernels or is comment #14 still valid?

The device ids seem to be in the kernel at kernel.org, but on my computer the keyboard is still detected as 'generic-bluetooth 0005:05AC:0255.0005: input,hidraw3: BLUETOOTH HID v0.50 Keyboard ' rather than any sort of apple wireless keyboard.

Not being a developer, I'm not really sure how the kernel works, but every version of the kernel I check, has 0x0255 listed in drivers/hid/hid-ids.h.

Not sure why this doesn't translate to a working keyboard on my computer.

It May be better off giving you more information about my current setup.

I have the hid_apple module loaded at startup via /etc/modules, and use the /etc/modprobe.d/hid_apple.conf file to configure specific settings for the driver.

Now comes the interesting part. If I place `options hid_apple fnmode=2` inside the latter, F* keys are working as expected but media keys (fn + f* keys) do not. On the other hand, if I leave the modproble settings file empty, everything works as expected (media keys defaulting on f* keys, and standard f* keys functions when using the fn modifier).

Jason, this bug was reported a while ago and there hasn't been any activity in it recently. We were wondering if this is still an issue? If so, could you please test for this with the latest development release of Ubuntu? ISO images are available from http://cdimage.ubuntu.com/daily-live/current/ .

If it remains an issue, could you please run the following command in the development release from a Terminal (Applications->Accessories->Terminal), as it will automatically gather and attach updated debug information to this report:

apport-collect -p linux <replace-with-bug-number>

Also, could you please test the latest upstream kernel available (not the daily folder, but the one all the way at the bottom) following https://wiki.ubuntu.com/KernelMainlineBuilds ? It will allow additional upstream developers to examine the issue. Once you've tested the upstream kernel, please comment on which kernel version specifically you tested. If this bug is fixed in the mainline kernel, please add the following tags:
kernel-fixed-upstream
kernel-fixed-upstream-VERSION-NUMBER

where VERSION-NUMBER is the version number of the kernel you tested. For example:
kernel-fixed-upstream-v3.12

This can be done by clicking on the yellow circle with a black pencil icon next to the word Tags located at the bottom of the bug description. As well, please remove the tag:
needs-upstream-testing

If the mainline kernel does not fix this bug, please add the following tags:
kernel-bug-exists-upstream
kernel-bug-exists-upstream-VERSION-NUMBER

As well, please remove the tag:
needs-upstream-testing

Once testing of the upstream kernel is complete, please mark this bug's Status as Confirmed. Please let us know your results. Thank you for your understanding.