Firemonkey: Soft Keyboard pops up when VKAutoShowMode is Never


I have a large firemonkey android application which is designed for use primarily on barcode scanner devices, but must also be usable on e.g. an android phone (for testing). When used on a barcode scanner device, which typically
has a physical keyboard, we suppress the virtual keyboard by setting VKAutoShowMode to TVKAutoShowMode.Never.

This works just fine for most of the Tedit components. However, for 1 or 2 of these – which are to all intents and purposes “the same” as the others – the virtual keyboard pops up when the key press is received from the physical keyboard. And furthermore, it is not easily dismissed by using the return key with KillFocusByReturn set on the relevant Tedit.

I can work around the problem using the Android Language & input settings to effectively disable the virtual keyboard completely, but this is less than ideal as in some fields we do want the soft keyboard for simpler alpha input.

I can also achieve a partial workaround by calling up our “HideVirtualKeyboard” routine within an onkeyup event for the problem Tedit(s), but this looks silly as the keyboard flashes up and then disappears.
Also, if one then moves to another TTabItem within the application after giving focus to the problem Tedit, a key press on the physical keyboard will pop the virtual keyboard up and special action has to be taken to get rid of it.

I would appreciate any suggestions.

Comments are closed.