Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keep virtual keyboard shown going from one edit to another

It seems the default behavior of FMX Android is that on clicking one edit and then another edit the virtual keyboard reopens.

After clicking the first edit the virtual keyboard is already shown so is there a way to keep the virtual keyboard open without the transition?

Based on this answer and this answer I expected I could set

VKAutoShowMode := TVKAutoShowMode.Never;

And then manually show the keyboard like this

procedure TForm8.FormCreate(Sender: TObject);
var
  keyboard: IFMXVirtualKeyboardService;
begin
  keyboard := TPlatformServices.Current.GetPlatformService(IFMXVirtualKeyboardService) as IFMXVirtualKeyboardService;
  keyboard.showVirtualKeyboard(Edit2);
end;

Allowing me to keep the keyboard open. This does put focus on Edit2, but it doesn't show the virtual keyboard.

The documentation says

If the on-screen virtual keyboard is shown, ShowVirtualKeyboard returns True, otherwise it returns False.

And indeed keyboard.showVirtualKeyboard(Edit2); return False.

Am I misunderstanding something?

like image 819
Bas van der Linden Avatar asked Feb 04 '26 11:02

Bas van der Linden


1 Answers

Try changing the ControlType property to 'Platform' for ALL Edit controls on the form. It worked for me.

like image 183
Josep Pagès Avatar answered Feb 06 '26 02:02

Josep Pagès



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!