access to Apple new aluminium keyboard special keys on a PC throught raw input or will I need a filt

Discussion in 'Windows Vista Drivers' started by John knipper, Oct 1, 2007.

  1. John knipper

    John knipper Guest

    Hi all,

    Said in one line:
    I would like to be able to access to all the keys of an Apple new
    aluminium keyboard on my PC (windows XP and up)

    Sorry If I ask dumb questions but I'm a total newbye in terms of
    windows drivers :)

    I bougth an Apple new aluminum keyboard to use on my PC. I'm not an
    Apple fan but I have to admit that this keyboard is excellent.

    The problem is the software. The software is not included in the box as
    only OSX is supported out of the box. They are windows XP (no x64
    support) but they work pretty badly on something else than an Apple

    If you are interested in the details, see here:

    I tried, the Apple forums. Got no help. Tried searching the web, found
    a lot of samples but my knowledge is too limited ritgh know to exploit
    them in the way I want.

    The keyboard once plugged in is recognized as a standad HID device.
    Most of the keys are working but some are not mapped correctly as they
    are located elsewhere on the keyboard.

    Then we have "special" keys. Especially two keys that I cannot manage
    to get access to directly (meaning without using the Apple softawre).
    It's an open/close CD tray and an Fn key that is used as a modifier for
    half of the F-serie keys. For example, Fn+F10 is sound off, Fn+F11,
    sound up etc.

    So, the software provided comes in two parts.

    The first part seems to be a simple usb filter that is re-mapping the
    PC key layout to the Apple key layout.

    The second part is a residant tool named as the Bott Camp control
    panel. This one is totally buggy. More in this later. That tool seems
    to provide the support for the special keys.

    Here is a short list of the problems I have:
    - the keyboard driver is missplacing a couple of keys.
    - the boot camp tool does only work properly on Apple hardware. But
    accepts to launch and provides me most of the features I can expect
    from the keyboard except that it carshes often, freezes my PC, crashes
    my PC, is poorly implemented: the Fn default key state is stored in the
    registry and is polled from there by the tool.
    - with all this installed, my second PC keyboard has it's keys switched
    to the Apple layout ;)
    - more...

    To the point :)
    I would like to get rid of those tools and code my own solution.

    Getting the correct layout is just a "MS keyboard layout creator" ahead.

    But the biggets problem for me is to get access to those two special

    I tried Emma burrom's rawinput approach:

    But the two keys I cannot catch are the CD tray open/close key and make
    the Fn combinaisons work. The only key that makes rawinput react with
    the Fn key is F7, I'm getting the following message:
    {msg=0xff hwnd=0xb09f8 wparam=0x0 lparam=0x6ab0211 result=0x0}


    My question is simple... hum ;) how can I get access to the CD tray key
    and to the Fn+key combinations?

    The only working thing catching those keys is the UsbSnoop:

    I'm trying to code something in C# but I guess that a sample in any
    language would be fine.

    Any hints about where I should start? Is there some info I can provide
    you to help you help me ? Any sample? something? Is the rawinput
    approach a dead end?

    Thanks a lot in advance for your help,

    John knipper, Oct 1, 2007
    1. Advertisements

  2. John knipper

    John knipper Guest

    Hello all, no idea or help about my problem? is my question too
    generic? should I ask more specific questions? thanks :)

    John knipper, Oct 2, 2007
    1. Advertisements

  3. John knipper

    Don Burn Guest

    Well it might help if you asked on a newgroup that answered hardware support
    questions, you are asking on one for people who write device drivers in
    C/C++ for the Windows kernel.

    Don Burn (MVP, Windows DDK)
    Windows 2k/XP/2k3 Filesystem and Driver Consulting
    Remove StopSpam to reply
    Don Burn, Oct 2, 2007
  4. DB> Well it might help if you asked on a newgroup that answered
    DB> support questions, you are asking on one for people who write
    DB> drivers in C/C++ for the Windows kernel.

    You missed the "I would like to get rid of those tools and code my own
    solution." part of xyr message.

    To which the response is the standard one: "The WDK documentation is
    your friend.".

    J de Boyne Pollard, Oct 2, 2007
  5. access to HID data is pretty straightforward from user mode, look at the
    documentation for hid.dll and the hclient sample in the WDK.

    Doron Holan [MSFT], Oct 2, 2007
  6. John knipper

    John knipper Guest

    Hello Don, I'm sorry, my message was a bit too long. I'll try to be
    more specific in the future. Thanks.

    John knipper, Oct 3, 2007
  7. John knipper

    John knipper Guest

    You are both right. The documentation is my friend but I did read many
    things about all this and I can say it is not trivial. But I guess you
    already know that ;)

    My biggest problem is probably that English is not my native language
    and that the documentation talks about many different type of "things"
    that often look alike to me. For example, maybe the best hint you could
    give me is what is the "thing" that will help me solve my problem?

    You are rigth by resuming my problem to the following:"I would like to
    get rid of those tools and code my own solution."

    I know that the best solution would be to wait for Apple to release the
    correct drivers but on the other side it looks fun and challeging to
    try to do it myself.

    Right now, It's only the beginning for me and I'm a bit lost. I would
    like to get your input to be sure I'm going into the right direction.

    So, is what I need a Class driver? A mini Driver? A mapper driver? None
    of them?

    I guess that I can resume my problem to two secondary problems:
    1/ map keys from one keyboard layout to another, I think that I can do
    that with a keyboard layout. that looks not to be too hard to do.
    2/ respond to keys not recognized by windows by default. for example
    the Eject key and all the combinaison with the fn key. fn + F10 that is
    toggle sound.

    This might be the though part for me. I did already take a good look at
    the hclient sample.

    I can access to the eject key and to the fn key combinations, but not
    the fn key alone, cool. But now, if I get correctly what the hclient
    sample is doing, it's that it is accessing directly the hid. this means
    that he will be the only one able to, minute, maybe I
    get it ;) It helps explaining to others where you're stuck...

    Do you agree with me when I say that I should base my program on a
    hclient subset, run in the background and listen for the "special"
    events from my keyboard and then do what is expected from me? like
    raize or lower the sound, eject the CD etc...

    Because I was not getting it how the programs where meant to
    interact... But they are not meant to interact. The window progarms are
    only meant to interact with the default know keys, and in case they
    need to access to those special keys they have to do it on their own.

    By the way, while talking about the hclient sample, I'm sorry but I
    could not find the difference between button data and value data. and
    all 3 kind of reports have them.

    Also why is the "blocked read data" only getting a part of the pressed
    keys (about half the special keys I want) and no default windows key.

    Is there a way to say, hey, look, a USB keyboard... why don't you
    listen to what it says and let me handle it if I want. Something like a
    keyboard hook. I can handle on the fly or just modify what is passing

    Last question... should I remove the apple drivers to be sure they do
    not interfere with what I'm doing or can I "live" with them side by

    Sorry it was very long again and you time is limited.
    I'll do my home work after that, I'll promiss ;)

    Thank you all for having read trough here and for your help, it is very
    appreciated, thanks again,

    John knipper, Oct 3, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.