How to display virtual keyboard when a physical keyboard is connected - ipad

Is there a way to programmatically force the virtual keyboard to appear when there is a bluetooth keyboard connected to the iPad?
I have a bluetooth barcode scanner connected to the iPad, which acts as HID (keyboard). The problem is, the virtual keyboard stays hidden in my app. Is there any way I could force the virtual keyboard to show without using any unofficial SDK calls?

Darn I was hoping someone would be able to answer this question! Goran have you been able to find anything since July?
I have one idea, although I'm not sure whether it works or not... Apparently the Apple bluetooth keyboard has a shortcut that opens the virtual keyboard. If, using javascript, you can send this command to the iPad, the virtual keyboard will open?? Is this possible?

Related

How to detect the Smart/external Keyboard on iPad?

How can one get a notification when a (Smart) keyboard is connected?
Some context:
I am working on a feature that automatically shows and hides my software keyboard based on whether the iPad Pro Smart Keyboard, or another external keyboard is connected or not (like Pages). I have seen this answer but that only applies when a textfield is selected. After a lot of googling, I stumbled into the Apple's ExternalAccessory class which you can ask for connected devices, and then check what these devices are.
I have tried a basic implementation of this and I can't get it to work on my iPad Pro with connected Smart Keyboard (Yes, I am sure it's connected because I can see the letters I type appear on my screen 😅).
First of all, the docs say that you can detect devices that are through over Bluetooth and Lightning, I can only to hope this also includes the Smart Keyboard connector. I have enabled the Wireless Accessory Configuration capability of my project.
Second, one needs to add the UISupportedExternalAccessoryProtocols key to their info.plist, then needs to specify which protocols are connected. Which protocols there are doesn't seem to be documented, also not for Apple's own devices. I ran into a tutorial that mentioned the iAP2 bluetooth protocol, so I added this and then hoped for the best.
My code
As I haven't set up my project configuration right yet, I didn't add a lot of code either. I tried:
func printAllAccessories() {
for device in EAAccessoryManager.shared().connectedAccessories {
print("connected device with name: ", device.name)
}
}
But noting seems to be connected.
Bottom line
What is the process, including project configuration, to get external keyboard notifications in an iOS App?
There doesn't seem to be any comprehensive documentation of this online so it's probably nice to get that here. Any help would be highly appreciated!
First of all this doesn't work because smart connector is not using bluetooth to connect to device. You can read more about that on this page Use your Smart Keyboard Folio or Smart Keyboard with iPad Pro.
Second thing is that apple Smart Keyboard and external keyboard is totally different thing. Apple Smart Keyboard can be used as iPad case and as iPad keyboard. External keyboard is used only as keyboard and nothing else.
So from this we can conclude that when you connect you Smart Keyboard to iPad with Smart Connector iPad will treat it as iPad case, which gives you protection for your iPad and no other functionality which would impact on your software(try to type on it or use any shortcuts, nothing will work). iPad will recognise Smart Keyboard as keyboard only when it will be folded in type position. This is the main difference from external keyboard. External keyboard will be recognised as soon as you connect it via bluetooth.
Pages app will hide keyboard only if the external keyboard is connected via bluetooth or your Smart Keyboard is in type position. If Smart Keyboard is connected to Smart Connector and is not in type position there will still be software keyboard until you fold it in to type position. This means that iOS will handle hiding and showing keyboard.
For handling key presses performed on hardware keyboard you can refer to this class UIKeyCommand.

How to enable virtual/soft keyboard while connected to a Bluetooth keyboard/Barcode Scanner for React Native on iOS?

I've been researching for quite a while and none of the solutions seemed viable enough. For example: articles as referred within Force software keyboard on iOS 10
Our bluetooth bar code scanner has a button which brings up/down the soft/virtual keyboard, but that's definitely not as user-friendly as having a keyboard popping up when focusing on text input.
Is there anyway to accomodate both virtual/soft keyboard and bluetooth keyboard input on iOS? Thanks!
We've also looked into this which seems promising, display soft keyboard (iPad) when is connected a bluetooth input device
but it requires importing of private framework which isn't supported on newer XCode's, and isn't App Store-Ready?

Display virtual keyboard with barcode scanner attached

We have written an enterprise app for a wholesaler client. The app directs their warehouse staff to different locations in the warehouse, telling them which products to pick.
The app allows the picker to double check they are picking the correct product by entering the barcode of the product they have picked up. The client has purchased a USB barcode scanner that allows them to scan directly into the app. The scanning of the barcode and validation works fine. The problem comes when the picker needs to enter the number of units they have picked up. They can't do it because the virtual keyboard has been hidden.
The virtual keyboard is hidden because (I assume) iOS thinks the barcode scanner is a hardware keyboard. Is there a way to force the virtual keyboard to remain on screen?
I have searched, but the various solutions either do not work for iOS8, or use private APIs (which I've not attempted to implement, as they look pretty ropey).
If this is not solve-able programatically, I am happy to advise the client to use a different scanner (I have seen some which seem to have a button press to bring up the virtual keyboard, etc). If you happen to know of a scanner that does this, please advise!
I realise I could use the camera on the device, but I don't think the client will go for this as the device is attached to a forklift and wouldn't be practical to pick up and scan all the time.
tl;dr: I'm trying to force the virtual keyboard to stay on screen because it is hidden when the barcode scanner is attached.

Would a physical keyboard prevent a inputAccessoryView from appearing?

I've added an inputAccessoryView to the iOS keyboard for certain UITextFields in my app. This accessory view provides essential functionality to the user (some buttons that are displayed nowhere else in my app). My understanding (which could be completely wrong) is that if a physical (bluetooth) keyboard is available iOS will not clutter the screen with the software keyboard. If that's the case, users of my app with a physical keyboard will be missing some functionality and I'll need to account for that. So the first question is, is that something I have to worry about? Thanks.
The input accessory view should appear at the bottom of the screen if a physical keyboard is used, so they will still be able to access the functionality. If you want to try this in the simulator, check the Simulate Hardware Keyboard option under the Hardware menu.

bluetooth keyboard override

Is there a way to force up a software keyboard when the user has a iOS bluetooth keyboard device installed?
Or, to that end, is it possible in code to disable a specific bluetooth device?
Thanks!
In most (maybe all?) iOS apps with which I have used Apple's bluetooth keyboard, pressing the eject key (located in the top right corner) will bring up the soft keyboard on the screen. Maybe that little factoid could help you in some way.
Not from within the application's code, if you're planning on getting into the app store. Apple expressly does not provide methods to show or hide keyboard, instead pushing you to use becomeFirstResponder and resignFirstResponder.
You may be able to do this through some non-AppStore-friendly methods, but somehow I don't think that's the answer you're looking for.
(Note - you could make a fake, Apple-looking keyboard when the real one is hidden, and check if the real one is hidden based on whether a view is visible, but if Apple notices you doing this, you'll get denied.)

Resources