I made an application that uses a Bluetooth barcode scanner. When the barcode scanner is connected, the keyboard will no longer appear on the screen. Therefore, I cannot use the on-screen keyboard to enter text. It is not very convenient to enter text through barcodes (since I want to enter very variable data), so I am looking for a way to present an on-screen keyboard, although an external keyboard is included. Apple's wireless keyboard achieves this by sending an eject key to the iPad.
I found on the Internet that the extraction key is code 161. I can do an NSString with the extraction key as follows:
// Put the eject key Unicode U+23CF in a NSString. Two different ways possible: NSString *eject = [NSString stringWithFormat:@"%C", 0x23CF]; NSString *eject2 = [NSString stringWithUTF8String:"\u23CF"];
When viewing the debugger, both NSStrings show the extraction icon as the contents of the NSString, so it seems like I have the code on the right to populate the NSString with the extract button. But my problem is how to send this NSString to the keyboard input system to trigger the pop-up on-screen keyboard? I cannot send it by creating a barcode with the contents of "\ u23CF" if it is not recognized as a UTF8 string. Setting the text UITextField (with or without a return key) also does not perform the task.
Can someone help me with this problem? Am I missing something? As far as I know, the only Apple manager who gives us the on-screen keyboard is startFirstResponder and resignFirstResponder, but this is useless when an external keyboard (or scanner) is connected.
source share