On Tue, May 25, 2010 at 9:05 AM, john smith
<email@hidden> wrote:
Thanks Paul,
well, I honestly just assumed it would work as on Windows, where we can simply pass the keyboard event on if we don't use it.
it works that way on windows only to the extent that the plugin owns the window and thus gets keyboard events directly. this is not a given even on that platform.
That works like a charm in all cases. (If the user double-clicked a text I will grab the keyboard input, otherwise I simply pass it on to the host).
keyboard events in every GUI toolkit i'm familiar with on every platform i know of are *always* delivered to a window because the target (the thing with "keyboard focus") within the window may not be under the control of or even known to the toolkit. so, if you don't own the window, you don't see the events unless the window owner chooses to let you see them. of course, its slightly more complex than that :)
So, we seem to have settled that Logic and AULab is not passing on the keyboard events to the plug-ins.
i'm not sure we've "settled" this at all. i would be very, very suprised if you can't get logic (at least) to forward key events to a plugin view.
Do you know if there's any other host which does, so that I can test the keyboard code?
the next version of Ardour (2.8.8, due out today or tomorrow) will use the "keyboard focus" button at the top of the plugin view window. if its clicked, all keyboard events delivered to that window will be forwarded to the plugin view. otherwise, ardour continues to use (all) keyboard events as its own shortcuts (since just about every possible key event is a shortcut to something).
Or even better, do you know if there's a way to hook into the keyboard chain (or whatever the proper term is), so I can "steal" the events when needed? (See above why this is not a bad idea).
that doesn't make it a good idea. its really a judgement call whether or not plugin-view-event-stealing is acceptable or even good, and that call will depend a lot on how the host uses the keyboard itself. i don't know of any way you can do this with cocoa, though i wouldn't claim to really be a deep cocoa programmer. if you try it, you will almost certainly mess up some or all hosts own keyboard-using behaviour.