Is it possible to read key codes of non-standard keys using an special iOS API or via the generic TextInput field? I have a multimedia keyboard with special buttons & like to make my iPad app aware of these key codes.
I know iOS can use some of them already (i.e. volume up/down, next/prev track).
You might want to try subclassing UIApplication and overriding sendEvent:
to see what events pass through there. Given that UIEvent doesn't document keyboard event support on iOS (as opposed to NSEvent in AppKit), I'm skeptical that you'll see keyboard events... but it's worth a try. I don't have a BT keyboard to try it out myself.
To use a UIApplication subclass, edit main.m
and pass your subclass as the third argument to UIApplicationMain:
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, YourApplicationSubclass, nil);
[pool release];
return retVal;
}
This strategy isn't uncommon in desktop Cocoa apps and is also explained here:
http://cocoawithlove.com/2009/05/intercepting-status-bar-touches-on.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With