Windows 8 on-screen keyboard detection using Javascript

I have a full screen web page with an input field. When the user taps an input field, the Windows 8 on-screen keyboard appears. This behavior is expected and required, but the keyboard closes the input field.

I want to be able to detect when Javascript is present on the Windows 8 on-screen keyboard so that I can handle the movement of the input field above the keyboard.

The input field is absolutely positioned on the screen, so the on-screen keyboard does not change the way the window is stored.

We would be grateful for any information regarding this.

Edit . I would also like to do this with Javascript, because then I can move the input field when the keyboard is rejected (which might not be handled when the window is clicked, since it can be canceled through the keyboard).

+3


source to share


1 answer


Could this help?

iPad Web App: Detecting Virtual Keyboard Using JavaScript in Safari?



$(document).ready(function(){
$('input').bind('focus',function() {
    $(window).scrollTop(10);
      var keyboard_shown = $(window).scrollTop() > 0;
        $(window).scrollTop(0);

     $('#test').append(keyboard_shown?'keyboard ':'nokeyboard ');
   });
});

      

I know this for iPad, but maybe there could be some workaround for regular browser? Not my own idea, it came from @LKM and I still don't fully understand it.

0


source







All Articles