Jump to content

prevent onscreen "virtual keyboard" on mobile/tablet?


Recommended Posts

On a tablet it seems that setting focus to an editbox brings up the tablet's virtual keyboard.

 

Is there a way to suppress that behaviour? I am expecting a numeric response from the user and I have my own "calculator pad" on the screen so the virtual keyboard is redundant.

 

So the question how to prevent the virtual keyboard activating?

Link to post
Share on other sites
  • Moderators

not sure if this is exactly what you want, but seems to do what you're after reading your description

 

 

w3_setAttrib(W3EditBox1.Handle, 'onfocus', 'blur()');

 

you might want to make this conditional to device detection

 

the normal click event still works

Link to post
Share on other sites

@Nico - thanks

 

It didn't work in my case.

 

What I have done is remove setfocus in the case of tablets. This prevents virtual keyboard appearing. However, if the user touched the editbox (i.e, setting focus) the keyboard appears.

Link to post
Share on other sites
  • Moderators

I quickly tested this on android mobile, where it prevents the virtual keyboard from appearing, even after touching the editbox.

 

as native keyboards are handled by the os directly, there may be differences between os-types, os-versions and maybe even browsers

 

what kind of tablets are you targeting ?

 

if everything fails you could always put a transparent W3Panel on top ...

Link to post
Share on other sites

Interesting, the beta RTL I am using does not prevent me clicking into any of the three editboxes. The Beta RTL behaves completely different than the current stable release of SMS. I will make a point of revisiting when the next stable release comes out.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...