Turn off Virtual Keyboard for one control in FireMonkey Android app

  

What’s the best way to turn off the virtual keyboard for a particular FMX.Edit.TEdit control?
Is it to use VKAutoShowMode := TVKAutoShowMode.Never; in the OnEnter event and VKAutoShowMode := TVKAutoShowMode.DefinedBySystem; in the OnExit event? I’m not entirely happy with this approach, as if something doesn’t go according to plan, the virtual keyboard is hidden for every control in the app.
Or just use Keyboard.HideVirtualKeyboard; in the OnEnter event? This sort of works, but if you click into the control a second time, the keyboard appears.
I can see the control has a KeyboardType property, but None is not one of the available choices.
Am I missing something here?
EDIT:
I cannot set ReadOnly to true, as it is being used for capturing the text from a barcode scanner.
EDIT:
Since VKAutoShowMode := TVKAutoShowMode.Never; works the majority of the time I’ll just continue to use that method, but add extra event handlers to use VKAutoShowMode := TVKAutoShowMode.DefinedBySystem; when other edit controls get the focus.

Comments are closed.