Hide/Disable Virtual Keyboard on Android for Barcode Scanner input

620 views
Skip to first unread message

William Starrs

unread,
May 16, 2017, 10:02:19 AM5/16/17
to Kivy users support
Hello,

I am trying to develop a front-end for a bar-code scanner.  The device is a Wasp DR2 and is an Android device (cell phone without SIM) fitted with a fancy bar-code scanner and extra buttons.

There is a "Scanner Service" always running in the background that I assume emulates a keyboard and dumps the results of the scan into whatever is active at the time.

I am attempting to use Kivy to oversee / validate a workflow where a user scans 4 barcodes in sequence (an inventory "action" such as in, out, move), a shelf location, an item serial #, and a destination.  I need a target for the scanner to dump into and am using for now a TextInput.  The issue is that as soon as the TextInput receives focus, up comes the virtual keyboard.  

These records will be written to a text file and later processed via script to update a SQL database.

For data integrity I want the keyboard disabled, I only want input from the scanner.

I couldn't find much on this particular topic by googling.  I did find Focus Behaviors including one to hide the keyboard, but am not sure how to implement or test.  Currently I just have the TextInput called in from a .kv file.

Any ideas?  Is there a way to capture and process a string of input without a TextInput target?

Thanks very much for any assistance.

Bill

Geekademy

unread,
May 16, 2017, 1:39:46 PM5/16/17
to kivy-...@googlegroups.com
This should work:

from kivy.config import Config
Config.set('kivy', 'keyboard_mode', 'system')
# Config.write()

https://kivy.org/docs/api-kivy.config.html#available-configuration-tokens



On 2017-05-16 07:02, William Starrs wrote:
Reply all
Reply to author
Forward
0 new messages