Force soft keyboard to be displayed even when hardware keyboard is present - react-native

I'm creating an app using react-native, the soft keyboard gets suppressed when there's a hardware keyboard connected. I need it to be shown.
I'm essentially asking the same question as here:Show soft keyboard even though a hardware keyboard is connected but specifically for react native.

You mean an external keyboard for your tablet?
You can try to set the keyboard type to 'null'.

You can also try to add the onPress="blur()" prop in your Input/TextInput

Related

Is Desktop Mode Accessible When Using Bluetooth Keyboards in ChromeOs v69?

I just found a great bluetooth keyboard by Brydge for the Pixel Slate and am wondering if current ChromeOs devices can manually transfer from "tablet" to "desktop" mode when you attach a bluetooth keyboard?
It seems like this is feasible by enabling a setting in developer mode. Thanks to #Skawtnyc's response on Reddit!
You can switch back and forth on the fly. Enable chrome://flags/#ash-debug-shortcuts and then you can use CTRL+SHIFT+ALT+T to switch back and forth between desktop and tablet mode.
If you connect a mouse it will automatically switch to desktop mode, but using this method you can still switch back and forth.
#Skawtnyc also points out a bug to watch out for when using an external display such as a monitor.
Keep in mind that when connected to a dock with an external display, this setup can trigger a crash/restart error. The cause is the virtual keyboard. Anything that causes the virtual keyboard to appear on screen will trigger it. The workaround is to go into Accessibility settings and turn off the on-screen keyboard. You don't need it anyway when using a physical keyboard.

Text Input from Bluetooth Barcode Scanner with no keyboard

I'm trying to build a react native app that receives input from a bluetooth barcode scanner which basically just acts as keyboard emulation. I'm receiving the input into a TextInput however I don't want to show the keyboard. However, if I dismiss the keyboard it doesn't accept input into the TextInput.
Is there any way to accept input from the barcode scanner without showing the keyboard?
I know this is an old question, but,
There is a property called showSoftInputOnFocus in newer react-native versions. Setting this to false keeps the keyboard hidden.
Working for me on v0.60.0
React-Native TextInput with focus but without keyboard showing

Automatically scroll the view up when keyboard is shown in react-native

How can I automatically scroll the view up when I focus in a TextInput box and a keyboard is shown such that the TextInput box is not hidden behind the keyboard?
This question has been asked on StackOverflow a few times and I implemented the solution here which is the general solution advised in most of the answers. This solution works fine in the iPhone simulator but doesn't work on the actual phone. Has anyone else experienced this problem that the solution doesn't work on the actual phone?
Second thing that I noticed after adding this solution is that now if I am focussing in a TextInput box and keyboard is shown, if I press a button or try to focus into a different TextInput box, the first touch is always consumed to hide the keyboard and the button is not pressed or the other TextInput box is not focussed. It is a little annoying for the user to have to do the operation twice. Has anyone else observed this problem?
Please let me know if you have any inputs on how to solve these problems?
I assume you are using this solution. I ran into the same problem and made some adjustments (see gist). I addressed both problems you describe. keyboardShouldPersistTaps solves your second problem.
I have not found the exact reason why the spacing works in Simulator but not on a real device. It has something to do with the timing. The original code sets a timeout on input focus and tries to scroll down after 50ms. Increasing this to for example 500ms makes it work on devices too, but I don't really like adding magic timeouts that I don't understand. I changed it, so onFocus I look up the element to scroll to and store a reference. When onKeyboardDidShow fires I use the reference.

Titanium: Disable keyboard to use a custom numberpad

I am trying to use a custom number pad with a textfield to take advantage of blur and focus. But, how to disable the keyboard permanently on ios. Everything I tried does not work.
"Textfield": {
keyboardVisible: false
}
Well, i don't think there is a way to disable keyboard on textfield, but if you can call your custom keyboard on a onClick event, maybe you can use a label instead of textfield and open your keyboard on click.
I know that isn't a optimal solution but maybe it is useful.
Another way to solve this problem is open directly a default pad number with attribute keyboardType : Ti.UI.KEYBOARD_DECIMAL_PAD and use Keyboard Toolbar.
I hope this is helpful.
This is currently not possible in Titanium, but it seems achievable on iOS:
https://stackoverflow.com/a/16467767/4626813
You might want to do a Feature Request Appcelerator JIRA. Check if it has already been requested before you create a new ticket. Refer to this question and also link back to the ticket here so that others can watch it with you.

How to detect external keyboard connectification in objective-c?

My application need to know are external keyboard connect or no. How could i do to know that? No Private API please. :)
If this is iOS related, I'm not sure why you'd want to detect this as the hardware keyboard acts exactly the same as the software keyboard (except with a few extra shortcuts for sound, brightness etc. which your app shouldn't use anyway).
If you're considering screen space, then the software keyboard will still send it's notifications when it is displayed or when it is hidden, so you can respond to those. For example, say you have the software keyboard up and then you connect your external keyboard. The software keyboard will hide, and will post the UIKeyboardWillHideNotification. So you can respond to that.