Code Monkey
Code Monkey

Reputation: 71

How can I detect when iOS 4 keyboard is on-screen versus Bluetooth?

I have some code that moves a UITextView out from under the on-screen keyboard. The problem is, sometimes people will surely use a Bluetooth keyboard instead.

How can I detect that that is what's being used for input?

Also, BTW: I can detect when the on-screen keyboard goes away, but how to approach the same intention when it's a wireless keyboard?

Thanks.

Upvotes: 0

Views: 899

Answers (1)

Zac
Zac

Reputation: 11

You can detect when a bluetooth keyboard is connected by registering for UIKeyboardWillShowNotification the same way that you did for detecting when the keyboard hides. If a BT keyboard is connected, you will not receive a keyboard will show notification when the text field or text view that is requesting the keyboard becomes the first responder.

Upvotes: 1

Related Questions