Page 1 of 4 123 ... LastLast
Results 1 to 10 of 40

Thread: [SOLVED] Expose and Dashboard keys don't work (macbook 4.1)

  1. #1
    Join Date
    Apr 2006
    Beans
    6

    Angry [SOLVED] Expose and Dashboard keys don't work (macbook 4.1)

    I hate asking questions, but I've finally been stumped beyond my own searching/linux knowledge and I need help.
    I have a macbook v4.1 and I've set the keyboard up to work as it would in MacOSX (to use the function keys as function keys I have to press fn + the function key)
    this is the behavior I want and so far the F1 & F2 keys work perfectly to turn up/down the brightness, F7=last track, F8=pause/play, F9=next track, F10=mute, F11=volumedown, F12=volumeup, and the eject key works (I'm using pomme)

    Here's what I want....my F3 key (expose key) should start the compiz "scale" plugin and my F4 key (dashboard key) should start the compiz "widget layer" plugin.....the problem is that compiz doesn't recognize the keys at all

    I even tried xev, but the keys still spit nothing out....how can a key not be sending any data at all (is it lack of support for the keyboard device at the kernel level, or is it transmitting data some other way....like a joystick dev)

    this is the only outstanding thing left for me to be completely happy with my ubuntu/macbook setup (well to be totally honest this and the audio problem...which is the fact that the sound is lacking bass, but I'm willing to wait for alsa to take care of this with the missing "surround" channel)

    I would think it would be easy to remap any key press....but I have no idea how to start without xev even letting me know what the keystroke is!?!

    Please if anyone can help, let me know.....everything else in terms of ubuntu on macbook rocks

    Eugene

  2. #2
    Join Date
    May 2008
    Beans
    745

    Re: Expose and Dashboard keys don't work (macbook 4.1)

    Yes, those two keys need a kernel patch in order to work. Below is one which maps the two keys to CYCLEWINDOWS and CALC, respectively. Ideally, the keys should be mapped to appropriate application launch (AL) keys, but the expose and dashboard are not defined as such upstream. Could be oversight, could be other reasons - I do not know. We might add a package to the mactel repository that maps these keys, to spare you the trouble of compiling your own kernel. Meanwhile, happy hacking.

    Code:
    diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
    index 1b2e8dc..160b967 100644
    --- a/drivers/hid/hid-input.c
    +++ b/drivers/hid/hid-input.c
    @@ -98,8 +98,8 @@ static struct hidinput_key_translation apple_fn_keys[] = {
            { KEY_BACKSPACE, KEY_DELETE },
            { KEY_F1,       KEY_BRIGHTNESSDOWN, APPLE_FLAG_FKEY },
            { KEY_F2,       KEY_BRIGHTNESSUP,   APPLE_FLAG_FKEY },
    -       { KEY_F3,       KEY_FN_F5,          APPLE_FLAG_FKEY }, /* Expos<E9> */
    -       { KEY_F4,       KEY_FN_F4,          APPLE_FLAG_FKEY }, /* Dashboard */
    +       { KEY_F3,       KEY_CYCLEWINDOWS,   APPLE_FLAG_FKEY }, /* Expos<E9> */
    +       { KEY_F4,       KEY_CALC,           APPLE_FLAG_FKEY }, /* Dashboard */
            { KEY_F5,       KEY_KBDILLUMDOWN,   APPLE_FLAG_FKEY },
            { KEY_F6,       KEY_KBDILLUMUP,     APPLE_FLAG_FKEY },
            { KEY_F7,       KEY_PREVIOUSSONG,   APPLE_FLAG_FKEY },
    Last edited by kosumi68; October 29th, 2008 at 11:00 PM.

  3. #3
    Join Date
    Aug 2005
    Location
    Huntsville, AL, USA
    Beans
    7,526
    Distro
    Ubuntu

    Re: Expose and Dashboard keys don't work (macbook 4.1)

    Quote Originally Posted by kosumi68 View Post
    We might add a package to the mactel repository that maps these keys, to spare you the trouble of compiling your own kernel. Meanwhile, happy hacking.
    That sounds like a good idea, though maintenance could be a nightmare. This is something that others have for in the past as well.

  4. #4
    Join Date
    May 2008
    Beans
    745

    Re: Expose and Dashboard keys don't work (macbook 4.1)

    Quote Originally Posted by cyberdork33 View Post
    That sounds like a good idea, though maintenance could be a nightmare. This is something that others have for in the past as well.
    Ah - but that is why Intrepid now comes with DKMS, which actually both compiles and installs the driver. The mactel dkms packages work that way. No binaries, all kernel versions and architectures supported. Neat, isn't it

  5. #5
    Join Date
    Aug 2005
    Location
    Huntsville, AL, USA
    Beans
    7,526
    Distro
    Ubuntu

    Re: Expose and Dashboard keys don't work (macbook 4.1)

    Quote Originally Posted by kosumi68 View Post
    Ah - but that is why Intrepid now comes with DKMS, which actually both compiles and installs the driver. The mactel dkms packages work that way. No binaries, all kernel versions and architectures supported. Neat, isn't it
    Yes that is probably best. Actually DKMS has been around, it is just that nobody used it (except the ATI proprietary drivers.)

  6. #6
    Join Date
    May 2008
    Beans
    745

    Re: Expose and Dashboard keys don't work (macbook 4.1)

    Ok, there is now a hid-dkms package in the mactel PPA. It maps the expose and dashboard keys to the linux keys KEY_CYCLEWINDOWS and KEY_CALC, respectively (see /usr/include/linux/input.h). On my Intrepid setup, it makes both keys appear as X event - the dashboard key even brings up the calculator

    Of course, mapping the keys to the approriate action is up to user space - the CYCLEWINDOWS and CALC were the closest approximations I could find. The (initially wrong) post showing the patch has been changed accordingly.

    UPDATE: After installing the package, one also needs to update the ramdisk, because hid gets loaded early.
    Code:
    sudo update-initramfs -u -v -k `uname -r`
    Then reboot, and it should be fine. Oh well, the whole solution is a bit hackish. If you accept the default keys, I can send the patch upstream, so that we eventually get rid of this long-standing problem.

    Enjoy!
    Last edited by kosumi68; October 29th, 2008 at 11:40 PM.

  7. #7
    Join Date
    Mar 2008
    Beans
    10

    Re: Expose and Dashboard keys don't work (macbook 4.1)

    Great, it worked at least after rebooting. But before you submit the patch upstream, tell me, is there a way to make use of F5 and F6 on MB 3,1? xev says that right now these are not mapped with any code. (Looks just like when I press the brightness keys – the only difference being that nothing happens.)
    At least for F5 it would be nice to have the ‘normal’ behaviour straight away, so I wouldn’t need to press both Fn+F5 in order to refresh. (Hmm… Where would I use F6 for?…)

  8. #8
    Join Date
    May 2008
    Beans
    745

    Re: Expose and Dashboard keys don't work (macbook 4.1)

    Quote Originally Posted by Debilski View Post
    Great, it worked at least after rebooting.
    Nice.

    But before you submit the patch upstream, tell me, is there a way to make use of F5 and F6 on MB 3,1? xev says that right now these are not mapped with any code. (Looks just like when I press the brightness keys – the only difference being that nothing happens.)
    I believe someone with an MB 3 would have to answer that one.

    At least for F5 it would be nice to have the ‘normal’ behaviour straight away, so I wouldn’t need to press both Fn+F5 in order to refresh. (Hmm… Where would I use F6 for?…)
    This will not do in a general mapping setup, I am afraid. It also touches on the hot topic of FN-key or not FN key set by default; a topic that stirs emotions

  9. #9
    Join Date
    Jul 2008
    Beans
    245
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Expose and Dashboard keys don't work (macbook 4.1)

    Hi kosumi68,

    yes it works. thanks. but i'd like to add 2 suggestions:

    1. would it be possible to additionally add a mapping from enter to insert (bootcamp style), just like from backspace to delete, with:
    Code:
    { KEY_ENTER, KEY_INSERT },
    maybe others might also need this key.

    Quote Originally Posted by kosumi68 View Post
    UPDATE: After installing the package, one also needs to update the ramdisk, because hid gets loaded early. Then reboot, and it should be fine.
    2. this approach is likely to cause new problems (and questions) after a kernel upgrade to a major version, because the module gets rebuilt after rebooting, but again isn't incorporated into the ramdisk. what about adding the option:
    Code:
    REMAKE_INITRD=y
    to dkms.conf?

    thanks in advance & ciao,
    Mario
    Last edited by _mario_; October 30th, 2008 at 02:03 AM.

  10. #10
    Join Date
    Aug 2005
    Location
    Huntsville, AL, USA
    Beans
    7,526
    Distro
    Ubuntu

    Re: Expose and Dashboard keys don't work (macbook 4.1)

    Quote Originally Posted by kosumi68 View Post
    This will not do in a general mapping setup, I am afraid. It also touches on the hot topic of FN-key or not FN key set by default; a topic that stirs emotions
    There should at least be a userspace way to change it whether it is default one way or the other...

    pommed allowed a change to the config file to reverse this behavior.

Page 1 of 4 123 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •