Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

Apple USB keyboard aluminium MB110LL/A configuration

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
32 posts
  • 1
  • 2
  • Next
Author
Message
dmvianna
l33t
l33t
User avatar
Posts: 742
Joined: Mon Mar 22, 2004 3:04 am
Location: Down Underland

Apple USB keyboard aluminium MB110LL/A configuration

  • Quote

Post by dmvianna » Mon Dec 24, 2007 10:01 am

I've spent the 24th of December trying to find the sanest solution to configure this new Apple keyboard. I'm far from satisfied. The calculator bit at the far right is mostly assigned to mouse events, and the Fn key is not detected by xev. Most other keys can be handled by xmodmap. On the bright side, the arrows, home, end, pgup, pgdown and delete (the PC delete rightwise key!) work as expected. I've tried non-generic keyboard configurations passed through xorg.conf, but this made things even worse. Any ideas?

[EDIT 1]: Oh, games-util/joystick comes with a nice toolie called evtest, which shows every keyboard event, even Fn!!! :D
[EDIT 2]: Unfortunately, the keycodes reported by evtest do not match with what xmodmap actually changes... They're randomly different! :?
[EDIT 3]: OK, so it is actually very simple: the keypad is locked in numlock off, even though the keymap recognises the key [clear] as NumLock, and the numlock LED in my laptop goes on when I press it. So it behaves exactly as described in the xorgcfg reference figure, where it shows how to move the pointer with the keyboard if the mouse is not working. Now I must find a way to be able to make numlock work... :| Interestingly, numlock on makes the internal keyboard of my MacBook move the pointer too, instead of letting me use the keypad numbers... :?
[EDIT 4]: Finally, a christmas gift! Both the internal and external keypads are working as expected. Set /etc/conf.d/keymaps with

Code: Select all

EXTENDED_KEYMAPS="keypad"
and then issue

Code: Select all

# /etc/init.d/keymap restart
But do so outside X, because the keymap will change substantially, and X will go crazy... You' been warned... Another thing: be sure to disable your previous .Xmodmap, because, as the keymap will change, your modifiers will point to different keys. After changing the keymap, be sure to recreate it from scratch (if you do use xmodmap).
[EDIT 5]: All that made NumLock work correctly in the console, but it is still the same in X. :P
[EDIT 6]: It's getting warmer... :) adding

Code: Select all

Option "XkbTypes"   "default+numpad(microsoft)"
to /etc/X11/xorg.conf makes the keypad behave mostly as expected, but = and Enter are still pointer events.
[EDIT 6]: Can't reproduce it anymore. No advance in X. Argh. :(
[EDIT 7]: getscancodes does not work in my system. AAARRRRGGGGHHH.
[EDIT 8]: Oh, finally reproduced the nice behaviour I got in Edit 4. I have to press shift+numlock to have the keypad working as expected. Now only KP_Enter is not working. Good enough for now. I' ll try to polish it later :wink:
[EDIT 9]: Got it working as expected, with NumLock working without the Shift key. I just had to add (to my .Xmodmap)

Code: Select all

keycode  77 = Pointer_EnableKeys
keycode 108 = KP_Enter
:twisted:
[EDIT 10]: There is a minor annoyance though. While numlock is on, the mouse can't click. Also, the numlock LED is permanently on. Oh, well, I hope either someone answers this post, or Xorg is fixed upstream... :P
Last edited by dmvianna on Mon Jan 14, 2008 11:31 am, edited 2 times in total.
Proprietary is theft. Pierre-Joseph Proudhon, if he had a chance
Powered by a MacBook Pro
Top
MisteR_TwO
n00b
n00b
Posts: 24
Joined: Fri Feb 09, 2007 7:17 pm

  • Quote

Post by MisteR_TwO » Fri Jan 04, 2008 7:36 pm

I've got me one of those fancy apple keyboards and I like it so far (random blink disconnecting from USB aside). The keycode for the "fn" button is 484 if I remember correctly. getscancodes won't show it since it runs in X, which it's keycodes stop at 255. I got it using a program whose name I forgot, but it was run from a console outside of X, where keycodes don't matter as much.

But the last time I posted about this, I was using sabayon. Switched back to gentoo now.

Later.
Top
deribin
n00b
n00b
Posts: 71
Joined: Mon Feb 03, 2003 9:06 am
Location: Prague

  • Quote

Post by deribin » Mon Jan 07, 2008 6:34 am

Just got my Aplle keyboard.
The only question I have is regarding "Fn" key. using xev I can't see scancode from this key and can not bind it to normal "Insert" key.

Any suggestions?
Top
twam
Apprentice
Apprentice
Posts: 189
Joined: Tue Feb 15, 2005 11:53 am
Location: Ammerbuch, Germany
Contact:
Contact twam
Website

  • Quote

Post by twam » Tue Jan 08, 2008 11:06 am

Hi!

I got als an Apple Keyboard today, in the international Version (MB110Z/A). Besides of the problem of the FN key and numlock, the key left from 1 is labeled with & and ± but it is mapped to ` and ~, and the key left oft Z is labeled with ` and ~ is mapped to < and >.

Is there a special keyboard model to choose to get this work under X11?

Regards
Tobias
Top
twam
Apprentice
Apprentice
Posts: 189
Joined: Tue Feb 15, 2005 11:53 am
Location: Ammerbuch, Germany
Contact:
Contact twam
Website

  • Quote

Post by twam » Tue Jan 08, 2008 11:35 am

showkey reports keycode 464 for the fn key.
Top
dmvianna
l33t
l33t
User avatar
Posts: 742
Joined: Mon Mar 22, 2004 3:04 am
Location: Down Underland

  • Quote

Post by dmvianna » Tue Jan 08, 2008 7:38 pm

twam wrote:Hi!

I got als an Apple Keyboard today, in the international Version (MB110Z/A). Besides of the problem of the FN key and numlock, the key left from 1 is labeled with & and ± but it is mapped to ` and ~, and the key left oft Z is labeled with ` and ~ is mapped to < and >.

Is there a special keyboard model to choose to get this work under X11?

Regards
Tobias
I would probably use

/etc/conf.d/keymaps:

Code: Select all

KEYMAP="us-acentos"
EXTENDED_KEYMAPS="keypad"
xorg.conf:

Code: Select all

Section "InputDevice"
	Identifier  "Keyboard1"
	Driver      "kbd"
	Option	    "XkbRules" "xorg"
	Option	    "XkbModel" "macintosh"
	Option	    "XkbLayout" "us-intl"
	Option	    "XkbTypes" "default+numpad:(microsoft)"
EndSection
And use xmodmap to change the mapping of the keys you mentioned. Run xev to get the right keycode numbers, then place it in your ~/.xmodmap file:

~/.xmodmap

Code: Select all

keycode <number> = ampersand sdg
keycode <number> =  dead_grave dead_tilde
You will probably need more instances to include the symbol which is supposed to appear when you press "7"+"shift" (that's where ampersand "&" is located in my keyboard) and any other misplaced characters (like "shift"+"," and "shift"+".", which is where I find "<" and ">".

Please note that in my system I use deadkeys (when I press accent keys they don't display anything until I press a letter key; when this happens, I get the letter displayed with the accent. To print the accent alone, I press its key then space). To get rid of this behavior, omit "-acentos", "-intl" and "-dead" in the examples above.

[EDIT]: Or maybe you could try this instead:

Code: Select all

Option	    "XkbLayout" "gr"
;-)
Proprietary is theft. Pierre-Joseph Proudhon, if he had a chance
Powered by a MacBook Pro
Top
twam
Apprentice
Apprentice
Posts: 189
Joined: Tue Feb 15, 2005 11:53 am
Location: Ammerbuch, Germany
Contact:
Contact twam
Website

  • Quote

Post by twam » Tue Jan 08, 2008 7:56 pm

Hello!

I'm already using

Code: Select all

Section "InputDevice"
        Identifier     "Keyboard0"
        Driver         "keyboard"
        Option  "XkbModel"   "macintosh"
        Option  "XkbLayout" "us"
        Option  "XkbVariant" "altgr-intl"
        Option  "XkbOptions" "lv3:ralt_switch"
EndSection
and tried "apple" as XkbModel. But still no use of that "fn" key.

I'm already trying with ~/.xmodmap, but I thought there should be a standard configuration for that thousands of apple keyboards. :) Besides of that, ~/.xmodmap is not executed automatically from my X11, I have to start this by hand. :/
Top
CdR
n00b
n00b
Posts: 1
Joined: Sat Sep 01, 2007 7:41 am

  • Quote

Post by CdR » Tue Jan 08, 2008 8:03 pm

The problem with Fn is only one -- you can not "see" scancode above 255 under X. So xev does not report it and you can not map it using xmodmap.
As far as I can understand, we need the way to replace 464 with something useful ( < 255 ).
I don't know how to do it. :(
Top
twam
Apprentice
Apprentice
Posts: 189
Joined: Tue Feb 15, 2005 11:53 am
Location: Ammerbuch, Germany
Contact:
Contact twam
Website

  • Quote

Post by twam » Tue Jan 08, 2008 8:08 pm

I tried setting 464 with xmodmap, but nothing happended.
Top
dmvianna
l33t
l33t
User avatar
Posts: 742
Joined: Mon Mar 22, 2004 3:04 am
Location: Down Underland

  • Quote

Post by dmvianna » Tue Jan 08, 2008 8:09 pm

twam wrote:I thought there should be a standard configuration for that thousands of apple keyboards. :)
Heh. I don't think Apple contacted X.org developers prior to releasing their new keyboard. The work would have been started as one of them bought one. ;-)
twam wrote:Besides of that, ~/.xmodmap is not executed automatically from my X11, I have to start this by hand. :/
That is easy: http://gentoo-wiki.com/HOWTO_Autostart_Programs.

Apparently you could change the scancode of a key during boot or with an /etc/init.d/ initscript. I didn't follow that path because I couldn't get the scancode for Fn, but apparently other people did.
Proprietary is theft. Pierre-Joseph Proudhon, if he had a chance
Powered by a MacBook Pro
Top
twam
Apprentice
Apprentice
Posts: 189
Joined: Tue Feb 15, 2005 11:53 am
Location: Ammerbuch, Germany
Contact:
Contact twam
Website

  • Quote

Post by twam » Tue Jan 08, 2008 8:25 pm

I managed that via KDE autostart.

Your idea of changing the scancode sounds very interesting. Do you have any hints on that or where to find more information?
Top
dmvianna
l33t
l33t
User avatar
Posts: 742
Joined: Mon Mar 22, 2004 3:04 am
Location: Down Underland

  • Quote

Post by dmvianna » Tue Jan 08, 2008 8:34 pm

I can't remember. :oops: I did find it before, and it led me to the getscancodes program, which didn't work on my system. Then I abandoned it.
Proprietary is theft. Pierre-Joseph Proudhon, if he had a chance
Powered by a MacBook Pro
Top
dmvianna
l33t
l33t
User avatar
Posts: 742
Joined: Mon Mar 22, 2004 3:04 am
Location: Down Underland

  • Quote

Post by dmvianna » Tue Jan 08, 2008 9:03 pm

I found some info, but it's not in English, so I will translate it here:

1. Leave X and go to a virtual console;
2. press Fn;
3. If you get no character after pressing it, run dmesg and you will find some info there resembling

Code: Select all

atkbd.c: Unknown key pressed (translated set 2, code 0x9e on isa0060/serio0).
  atkbd.c: Use 'setkeycodes e01e <keycode>' to make it known.
4. Usually keycodes between 121 and 225 are not used. For example, we could use keycode 122, but to make sure it's free run

Code: Select all

# getkeycodes | grep 122
If there's no output we can use it.
5. Now we can associate the hexadecimal code generate by the key (displayed in dmesg) and the keycode we chose with

Code: Select all

# setkeycodes e01e 122
6. We can autorun this command upon boot.

:wink:
Proprietary is theft. Pierre-Joseph Proudhon, if he had a chance
Powered by a MacBook Pro
Top
dmvianna
l33t
l33t
User avatar
Posts: 742
Joined: Mon Mar 22, 2004 3:04 am
Location: Down Underland

  • Quote

Post by dmvianna » Tue Jan 08, 2008 9:09 pm

The thing is, pressing Fn in my system does not return anything in dmesg. But if you get hold of the hex code for Fn, then you can set it to be recognised in X.

The source of that information also mentions that in order to dmesg to display anything, the keypress has to be recognised by the kernel. The thing is, some keyboards have proprietary ways of doing such things which are not detected by the kernel, and in those instances one can't use that method.

This does not mean that nothing can be done, though. My Fn key works on the laptop through a MacBook-tailored app called app-laptop/pommed. My guess is we will have to wait for developers to come up with an app which will bypass the kernel to recognise the Fn key, just like pommed does, in the new Apple keyboard. :|

[EDIT]: But then again, if you found keycode=464, it means your kernel DID detect it. So I don't know what's wrong with my system. :P
Proprietary is theft. Pierre-Joseph Proudhon, if he had a chance
Powered by a MacBook Pro
Top
twam
Apprentice
Apprentice
Posts: 189
Joined: Tue Feb 15, 2005 11:53 am
Location: Ammerbuch, Germany
Contact:
Contact twam
Website

  • Quote

Post by twam » Wed Jan 09, 2008 12:37 pm

Hmm.... There's something strange here as well. I did fount the keycode 464 with showkey, but getkeycodes shows an empty table to me, which should be full :/

Code: Select all

Einfache Scancodes xx (hexadezimal) und Tastencodes (dezimal).

 0x00:    0   -   -   -   -   -   -   -
 0x08:    -   -   -   -   -   -   -   -
 0x10:    -   -   -   -   -   -   -   -
 0x18:    -   -   -   -   -   -   -   -
 0x20:    -   -   -   -   -   -   -   -
 0x28:    -   -   -   -   -   -   -   -
 0x30:    -   -   -   -   -   -   -   -
 0x38:    -   -   -   -   -   -   -   -
 0x40:    -   -   -   -   -   -   -   -
 0x48:    -   -   -   -   -   -   -   -
 0x50:    -   -   -   -   -   -   -   -
 0x58:    -   -   -   -   -   -   -   -
 0x60:    -   -   -   -   -   -   -   -
 0x68:    -   -   -   -   -   -   -   -
 0x70:    -   -   -   -   -   -   -   -
 0x78:    -   -   -   -   -   -   -   -

Scancodes mit Escape e0 xx (hex).

e0 00:    -   -   -   -   -   -   -   -
e0 08:    -   -   -   -   -   -   -   -
e0 10:    -   -   -   -   -   -   -   -
e0 18:    -   -   -   -   -   -   -   -
e0 20:    -   -   -   -   -   -   -   -
e0 28:    -   -   -   -   -   -   -   -
e0 30:    -   -   -   -   -   -   -   -
e0 38:    -   -   -   -   -   -   -   -
e0 40:    -   -   -   -   -   -   -   -
e0 48:    -   -   -   -   -   -   -   -
e0 50:    -   -   -   -   -   -   -   -
e0 58:    -   -   -   -   -   -   -   -
e0 60:    -   -   -   -   -   -   -   -
e0 68:    -   -   -   -   -   -   -   -
e0 70:    -   -   -   -   -   -   -   -
e0 78:    -   -   -   -   -   -   -   -
Maybe this all isn't working with hid (usb) devices and only with gold AT keyboards (atkbd.c).

I'm waiting for my new MacBook and I'll test it there with the internal keyboard as well.
Top
dmvianna
l33t
l33t
User avatar
Posts: 742
Joined: Mon Mar 22, 2004 3:04 am
Location: Down Underland

  • Quote

Post by dmvianna » Wed Jan 09, 2008 12:41 pm

I do get an empty table too. But as I said, the MacBook inbuild keyboard works properly with pommed, Fn included, no need to fiddle. :| Maybe it's a limitation of the HID kernel driver, that needs to be fixed? :roll:
Proprietary is theft. Pierre-Joseph Proudhon, if he had a chance
Powered by a MacBook Pro
Top
twam
Apprentice
Apprentice
Posts: 189
Joined: Tue Feb 15, 2005 11:53 am
Location: Ammerbuch, Germany
Contact:
Contact twam
Website

  • Quote

Post by twam » Sat Jan 12, 2008 1:47 pm

My MacBook arrived!

Same issues here: Fn has code 464 and scancode table is empty. :/
Top
twam
Apprentice
Apprentice
Posts: 189
Joined: Tue Feb 15, 2005 11:53 am
Location: Ammerbuch, Germany
Contact:
Contact twam
Website

  • Quote

Post by twam » Sun Jan 13, 2008 4:21 pm

I managed to get the Fn+F1, ... Fn+F12 work on my macbook.

I had to change the dev_id of my keyboard in drivers/hid/usbhid/hid-quirks.c

Edit: Desktop is working now, too!

Update
#define USB_DEVICE_ID_APPLE_GEYSER4_ISO 0x021b
in
drivers/hid/usbhid/hid-quirks.c
to your device id. You'll get it from lsusb.

The table is still empty and Fn has keycode 464, but I can use all the Fn-Combinations.
Top
dmvianna
l33t
l33t
User avatar
Posts: 742
Joined: Mon Mar 22, 2004 3:04 am
Location: Down Underland

  • Quote

Post by dmvianna » Sun Jan 13, 2008 9:23 pm

twam wrote:I can use all the Fn-Combinations.
Awesome! It works here too! :)

One last question: are you able to switch to VCs? I was able until I got the USB keyboard and a new screen. I'm not sure what is the problem, but I can't do it anymore... :P
Proprietary is theft. Pierre-Joseph Proudhon, if he had a chance
Powered by a MacBook Pro
Top
twam
Apprentice
Apprentice
Posts: 189
Joined: Tue Feb 15, 2005 11:53 am
Location: Ammerbuch, Germany
Contact:
Contact twam
Website

  • Quote

Post by twam » Mon Jan 14, 2008 8:17 am

Yes I am! But in default you have to press Control+Alt+Fn+FX or you have to set

Code: Select all

echo 0x02 > /sys/module/hid/parameters/pb_fnmode
Top
dmvianna
l33t
l33t
User avatar
Posts: 742
Joined: Mon Mar 22, 2004 3:04 am
Location: Down Underland

  • Quote

Post by dmvianna » Mon Jan 14, 2008 8:55 am

Just realised my keymap is different now that I'm using Option = "xkbmodel" "macintosh". I'll have to figure out a new keyboard layout in order to make all that work nicely as before. :P

[EDIT]:
Plus, I didn't realise that, as I am now using keycode 108 = KP_Enter (for the desktop keyboard), I am cancelling the previous keycode 108 = Pointer_Button_3 I had, so the KP_Enter button in the laptop would be used to call the root menu in Fluxbox... Things are getting clearer now. :mrgreen:

[EDIT 2] VC switching fixed... :) Some silly bug, fixed by mkdir /var/lib/xkb/compiled. Also, Option "XkbLayout" "us-intl" is deprecated, the new option for the same thing is Option "XkbLayout" "latin".

[EDIT 3] Yes, VC switching is working... but the keypad is not working on X anymore. :P
Proprietary is theft. Pierre-Joseph Proudhon, if he had a chance
Powered by a MacBook Pro
Top
twam
Apprentice
Apprentice
Posts: 189
Joined: Tue Feb 15, 2005 11:53 am
Location: Ammerbuch, Germany
Contact:
Contact twam
Website

  • Quote

Post by twam » Mon Jan 14, 2008 11:32 am

Try

Code: Select all

Section "InputDevice"
        Identifier     "Keyboard0"
        Driver         "keyboard"
        Option  "XkbModel"   "pc105"
        Option  "XkbLayout" "us"
        Option  "XkbVariant" "altgr-intl"
        Option  "XkbOptions" "lv3:ralt_switch"
EndSection
This should be the correct successor of us-intl.
Top
dmvianna
l33t
l33t
User avatar
Posts: 742
Joined: Mon Mar 22, 2004 3:04 am
Location: Down Underland

  • Quote

Post by dmvianna » Mon Jan 14, 2008 12:03 pm

Nope. The keypad stopped working, and the dead keys went alive. 8O

If you give me your reference, I could find the right config for me. :wink:
Proprietary is theft. Pierre-Joseph Proudhon, if he had a chance
Powered by a MacBook Pro
Top
twam
Apprentice
Apprentice
Posts: 189
Joined: Tue Feb 15, 2005 11:53 am
Location: Ammerbuch, Germany
Contact:
Contact twam
Website

  • Quote

Post by twam » Mon Jan 14, 2008 12:05 pm

/usr/share/X11/xkb/rules/xorg.lst lists all valid options.

For the keypad problem, maybe we need to set another define in the kernel files.
Top
dmvianna
l33t
l33t
User avatar
Posts: 742
Joined: Mon Mar 22, 2004 3:04 am
Location: Down Underland

  • Quote

Post by dmvianna » Mon Jan 14, 2008 12:16 pm

twam wrote:For the keypad problem, maybe we need to set another define in the kernel files.
Do you have the same keypad problem?

Do you use x11-misc/xkbdata or x11-misc/xkeyboard-config? I get

Code: Select all

setxkbmap -model macintosh -layout us -variant intl -option lv3:ralt_switch
Error loading new keyboard description
same with altgr-intl... :?

[EDIT]: Numpad issue solved!

Code: Select all

 Option      "XkbOption" "numpad:mac"
But now I have to find out how to kill the dead keys again... They're alive! 8O

[EDIT 2]: OK, a sane combination (finally):

Code: Select all

setxkbmap -model pc105 -layout us -variant intl -option numpad:mac
But... Then I need Fn+Control+Alt+FX to switch consoles. That is extremely uncomfortable in the desktop keyboard. :P

[EDIT 3]: so the present xorg.conf keyboard section looks like:

Code: Select all

Section "InputDevice"
        Identifier  "Keyboard1"
        Driver      "keyboard"
        Option      "XkbModel" "pc105"
        Option      "XkbLayout" "us"
        Option      "XkbVariant" "intl"
        Option      "XkbOption" "numpad:mac"
EndSection
Proprietary is theft. Pierre-Joseph Proudhon, if he had a chance
Powered by a MacBook Pro
Top
Post Reply

32 posts
  • 1
  • 2
  • Next

Return to “Kernel & Hardware”

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