Jump to content
Sign in to follow this  
Czar

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?

Share this post


Link to post
Share on other sites

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

Share this post


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.

Share this post


Link to post
Share on other sites

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 ...

Share this post


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.

Share this post


Link to post
Share on other sites

I decided to drop the so called outcoming new RTL, but anyway I suspect the TW3CustomControls is using tabIndex everywhere 

w3_setAttrib(self.handle,'tabindex',0); I don't know maybe disabling the tabbing to input fields ('tabindex', '-1') could help I guess.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×