I need to detect if a bluetooth keyboard is attached.
Ive seen How can I detect if an external keyboard is present on an iPad? but that answer requires darwin notifications which arent even available to iOS as far as i know. Not to mention it wasn't explained how to do them anyway.
But I need a way to detect if a bluetooth keyboard is connected or not. The problem is I have some devices that may be connected to the iphone. If one is not, then I must set a hidden text field as first responder by default. As of now I cannot figure out a way to set focus to the hidden text field only when a bluetooth keyboard is in use. If there is no bluetooth keyboard, I don't want to set focus. The reason why is with no bluetooth keyboard, the iOS keyboard displays on screen and I don't want it to.
The reason I want to set focus to this hidden field with a keyboard connected is because the keyboard is actually a barcode scanner, that the iphone detects as a keyboard. But I want to be able to have the user scan data to the textfield as normal.
Using keyboard notifications and text field delegates so far has not worked to solve my problem of not showing the keyboard but keeping textfield focus.