Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread Keyboard on mobile devices
Sat, May 20 2017 12:23 PMPermanent Link

Uli Becker

Hi,

I use a login form on a mobile device. In the OnShow event I use this code:

procedure TLoginForm.LoginFormShow(Sender: TObject);
begin
   edUsername.Text := '';
   edPassword.Text := '';
   edUsername.setFocus;
end;

Setting the focus works as expected but the virtual keyboard doesn't
appear. Only after tapping in the edit control it pops up.

LoginForm is an embedded form, but changing that doesn't help.

Any ideas?

Thanks Uli
Mon, May 22 2017 4:24 AMPermanent Link

Matthew Jones

Uli Becker wrote:

> Setting the focus works as expected but the virtual keyboard doesn't appear. Only after tapping in the edit control it pops up.

What exact device? Android, or iOS? I ask because I had this on my Android tablet at the weekend. The caret was sitting there waiting, but no keyboard until I tapped on it to show it. In a mainstream application. I figure this is "just normal".

--

Matthew Jones
Mon, May 22 2017 4:32 AMPermanent Link

Uli Becker

Matthew,

> What exact device? Android, or iOS? I ask because I had this on my Android tablet at the weekend. The caret was sitting there waiting, but no keyboard until I tapped on it to show it. In a mainstream application. I figure this is "just normal".

It's an Android device.
Subsequent calls of the form work as expected (keyboard appears after
the focus has been set).

Uli
Mon, May 22 2017 4:45 AMPermanent Link

Matthew Jones

Uli Becker wrote:

> Subsequent calls of the form work as expected (keyboard appears after the focus has been set).

Hmm, I have got one bit of code that keeps doing async calls until it can set the focus as expected, but that's because I am doing major earthworks in the DOM and so things haven't settled down. I've also used a timer for such positioning. Key is, is focus really there...

You might perhaps have a timer to show the currently focused object in a label. See if it is really focused.

--

Matthew Jones
Mon, May 22 2017 7:36 AMPermanent Link

Uli Becker

Matthew,

> You might perhaps have a timer to show the currently focused object in a label. See if it is really focused.

Yes it's focues and I tried to delay the setFocus by using a timer
earlier - no success though.

Thanks Uli


Mon, May 22 2017 9:45 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Uli,

<< Setting the focus works as expected but the virtual keyboard doesn't appear. Only after tapping in the edit control it pops up.

LoginForm is an embedded form, but changing that doesn't help. >>

I tried this:

procedure TForm1.Form1Show(Sender: TObject);
begin
  Edit1.Text:='';
  Edit1.SetFocus;
end;

and yes, the keyboard does *not* appear.  The answer as to why is here:

https://stackoverflow.com/questions/6837543/show-virtual-keyboard-on-mobile-phones-in-javascript

Tim Young
Elevate Software
www.elevatesoft.com
Tue, May 23 2017 5:29 AMPermanent Link

Uli Becker

Tim,

> and yes, the keyboard does *not* appear.  The answer as to why is here:
>
> https://stackoverflow.com/questions/6837543/show-virtual-keyboard-on-mobile-phones-in-javascript

OK. Thanks.

Uli
Image