I'm developing an ios app which may use external bluetooth wireless keyboard. I need to detect when the control keys are pressed down and when are up. I already know how to detect such control keys when the key is pressed by implementing function keyCommands as shown in iOS: How to detect the escape/control keys on a hardware bluetooth keyboard?
- (NSArray *) keyCommands {
UIKeyCommand *esc = [UIKeyCommand keyCommandWithInput: UIKeyInputEscape modifierFlags: 0 action: @selector(esc:)];
return [[NSArray alloc] initWithObjects: esc, nil];
}
- (void) esc: (UIKeyCommand *) keyCommand {
// Your custom code goes here.
}
However, this does not differentiate when the key is actually pressed down and when the key are actually pressed up? My app needs to differentiate this.
Could anyone help with this? Thanks.