Search code examples
ipadcocoa-touchuikituitextfielduitextfielddelegate

Detecting Tab Key Press On Bluetooth Keyboard


If a bluetooth keyboard is connected to an iPad, I can pick up the enter key with:

-(BOOL)textFieldShouldReturn:(UITextField *)textField

but what do I use if I need to detect the tab key as well?

FYI using your hardware keyboard in the ios simulator is essentially the same thing.


Solution

  • Good luck; see the below post for a thorough dive into this question. :)

    http://weaklyreferenced.wordpress.com/2012/11/13/responding-to-the-tab-and-shift-tab-keys-on-ios-5-ios-6-with-an-external-keyboard/

    The short answer is that iOS (at least as of iOS 6) does not expose a similar method for the tab key, and you'll have to get creative in order to detect it.