1 year ago

#353308

test-img

5eb

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?

delphi

firemonkey

delphi-11-alexandria

0 Answers

Your Answer

Accepted video resources