Is it possible to disable the keyboard in TextInput?

I have an application in expo, which aims to fetch a price in an api, I use a bar reader as data input (a physical reader) but when input receives focus from the keyboard and is activated, I don’t want this to happen, is there a solution ?
I’ve tried to read what comes from the port but without success with the Libs.

Hi @devcaioeduardo

I just saw this project mentioned in the React Native Newsletter:

One of the features is listed as “interactive keyboard dismissing :point_up_2::iphone:”, so maybe it can do something like what you’re asking.

I assume you mean you tried using the scanner’s API to directly access the scanned data. Does the scanner have a React Native API?

“interactive keyboard dismissal” from what I’ve seen this is a way to dismiss the keyboard when the user clicks somewhere other than the input for example… as if it were keybord.dimiss
It doesn’t work for me unfortunately.

I think I wasn’t clear, sorry
i tried to read the usb port that connects with device with the lib

but I can’t even install it, due to incompatibility.
as I couldn’t “disable the keyboard” I tried to read what the scanner is sending but without success.

Ok, I see. I would assume the scanner has some sort of library that you can use to read the barcodes. It would be higher level than reading the USB port directly.

If they have a React Native library there’s a good chance you can use that, but you might need to write a config plugin.

If they don’t have a React Native library, but they have native Android and iOS libraries, you would need to write a React Native module that calls the native library. See the Expo Module docs.

I created a lib to read directly from the USB port, but I didn’t test it to see its result in production, when I went to perform the tests on a device (I generated an APK) I noticed that android automatically disables the keyboard when a USB device is connected. So at the end of the day, all I had to do was test the application on a physical device with an APK.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.