Sherlock 663 Posted December 6, 2019 So I have this application, that runs smoothly on a standard PC, and does quite well on a tablet too. With one exception, the virtual keyboard causes quite the headache. Not only does Windows seem to have two different virtual keyboards, they behave quite differently too: First there is the keyboard that has to be actively opened by the user by clicking on the symbol in the tray area. This works fine, but has the disadvantage of "an additional click". (Image 1) Then there is a keyboard (image 2) that can be opened automatically when FMX.Types.VKAutoShowMode := TVKAutoShowMode.Always; is set. According to the fine manual this will cause the virtual keyboard to show even if there is a physical keyboard present. So as soon as the focus is set on an editable component like TEdit, this keyboard will popup and as soon as said component looses focus the keyboard will disappear. Now here's the tricky part: This keyboard looks different, and on some machines (HP tablets with an i5) takes ages (at least 30 seconds) to "pop up". On my VM that I'm running on a Mac with an i7, this happens instantly. Any user who knows iOS will consider option 1 to be "out of the question" so I use option 2, but for the life of me am not able to speed up the virtual keyboard popup process. This might just become a deal breaker, hence this post. TL;DR: Does anyone here have experience with virtual keyboards on Windows tablets, and knows how to open them up quickly on slower systems? Thanks, Sherlock Share this post Link to post
Der schöne Günther 316 Posted December 6, 2019 The second one ("OSK") is a legacy keyboard while the first one ("tabtip") is the one that should be used, in my opinion. Normally, Windows will invoke the keyboard when clicking/tapping text boxes with a finger (or pen, when configured). With FMX, it's still painted internally and not a "true" windows edit field with a HWND, right? I see FMX does its own thing in TVirtualKeyboardWin.Create (FMX.Platform.Win.pas), so you can probably use the global variable "VirtualKeyboardWin" and stuff in an implemtation that does not use the hardcoded path to "osk.exe". 1 Share this post Link to post
Sherlock 663 Posted December 6, 2019 Hmmm, I don't quite follow. Could you please elaborate? Share this post Link to post
Der schöne Günther 316 Posted December 6, 2019 The sourcecode from FMX.Platform.Win.pas (at least in 10.0 Seattle) does it all by itself and just launches "osk.exe" which is the keyboard from your second picture. The first one ("tabtip.exe") can (and as I believe, should) be launched instead. Here is an example: https://www.delphipraxis.net/186239-win-8-bzw-10-touch-tastatur-aufrufen.html#post1312405 Here is another but (not Delphi): https://github.com/AlexeiScherbakov/osklib I see that TVirtualKeyboardWin.Create() in Fmx.Platform.Win.Pas may use hardcoded paths to "osk.exe", but there is also a global variable "VirtualKeyboardWin". I think you should be able to subclass TVirtualKeyboardWin to use "tabtip" instead. And thenm let the global variable point to an instance of your subclass. 1 Share this post Link to post
Sherlock 663 Posted December 9, 2019 Great! Thank you, I'll give that a try. Share this post Link to post