Jump to content


Photo

prevent onscreen "virtual keyboard" on mobile/tablet?


  • Please log in to reply
9 replies to this topic

#1 Czar

Czar
  • Members
  • 165 posts

Posted 05 June 2017 - 01:29 AM

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?



#2 Nico Wouterse

Nico Wouterse
  • Moderators
  • 262 posts
  • LocationAustralia

Posted 05 June 2017 - 04:06 AM

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


Nico Wouterse

#3 Czar

Czar
  • Members
  • 165 posts

Posted 05 June 2017 - 04:26 AM

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



#4 Nico Wouterse

Nico Wouterse
  • Moderators
  • 262 posts
  • LocationAustralia

Posted 05 June 2017 - 05:22 AM

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


  • Czar likes this
Nico Wouterse

#5 Czar

Czar
  • Members
  • 165 posts

Posted 05 June 2017 - 05:32 AM

I was testing on a samsung - recent android.

The transparent panel will certainly solve the unwanted behaviour.



#6 Nico Wouterse

Nico Wouterse
  • Moderators
  • 262 posts
  • LocationAustralia

Posted 05 June 2017 - 05:44 AM

just for interest sake

 

can you check http://www.lynkfs.co.../www/index.htmlon your samsung ?

 

it doesn't pop up a keyboard when i touch it on my samsung android

 

 

edited :

project source http://www.lynkfs.co.../keyboard.sproj


Nico Wouterse

#7 Czar

Czar
  • Members
  • 165 posts

Posted 05 June 2017 - 06:49 AM

I get no virtual keyboard - just a "click" dialog



#8 Nico Wouterse

Nico Wouterse
  • Moderators
  • 262 posts
  • LocationAustralia

Posted 05 June 2017 - 08:24 AM

for future reference : 3 editboxes

1) normal editbox

2) blurred

3) hidden

 

source http://www.lynkfs.co.../keyboard.sproj


  • Czar likes this
Nico Wouterse

#9 Czar

Czar
  • Members
  • 165 posts

Posted 05 June 2017 - 09:35 AM

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.



#10 Laksekjønn

Laksekjønn
  • Members
  • 455 posts

Posted 06 June 2017 - 04:11 PM

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.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users