On Dec 4, 2007 6:45 PM, Nicholas Tam <nick@...> wrote:
> It was reading the controller data starting from the wrong bit.
Yep. I put your fix in and button presses are now showing in the CC QC view.
> However, I can't get user-defined keypresses (ASCII characters typed
> in the pref pane, as opposed to the dropdown menu) to work. This
> applies to all the preference panes, not just the CC.
Hmm... They are working fine for me under 10.5. The Wiimote and
Nunchuk mappings work fine; and I have one key on the CC working now.
I'm in the process of getting the other keys to work. I think I
really screwed up when I ripped out the CC support from 0.5; it is a
LOT of manual work to get the model bindings back in.
> I think the
> implementation of how to map buttons to specific keys may require a
> complete overhaul - I certainly couldn't find a solution.
I'm open to suggestions, but I don't really know what I'm doing in
this area. If there's a better way, I'd be glad to see it - and let
you write it. B^)
> The problem is this:
> The way it looks like it was meant to work, the user selects "Key"
> from the dropdown menu, types a character in the box, and it's stored
> data model for the key configuration (i.e. the preference file). So
> far, so good. But what happens is that the app is supposed to read
> the char stored in the key, convert it to a keyboard-layout-
> independent virtual keycode, and generate the corresponding keypress.
That's my understanding, too.
> Look in AppController.m -> buttonChanged:isPressed. The line that
> does this reads:
> short keycode = AsciiToKeyCode(&table, c)
> which is supposed to do the conversion. The problem is that
> AsciiToKeyCode(), which is implemented in iGetKeys.c, is deprecated
> and simply doesn't work; it consistently returns -1.
Hmm... It works for me - mostly. I use the Dvorak key layout and it
does not return the RIGHT key when I have the keyboard set to Dvorak,
but if I set it to US it works fine.
Perhaps the keycode needs to be stored rather than the ASCII value?