Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent key presses until keyboard is shown #426

Closed
Saiberion opened this issue Jan 14, 2016 · 4 comments
Closed

Prevent key presses until keyboard is shown #426

Saiberion opened this issue Jan 14, 2016 · 4 comments

Comments

@Saiberion
Copy link

Is it possible to prevent key presses until the keyboard is shown?

I have problems with the keyboard on a touch screen. If I tap a textbox to open the keyboard it can happen that the key that will appear on that position is pressed and added to the input text.

@Mottie
Copy link
Owner

Mottie commented Jan 14, 2016

Hi @Saiberion!

Why is the keyboard appearing over the input?

Anyway, you can disable the keyboard before it becomes visible, then enable it after a certain number of milliseconds (demo):

$(function() {

    $('#keyboard').keyboard({
        beforeVisible: function(e, keyboard, el) {
            keyboard.enabled = false;
        },
        visible: function(e, keyboard, el) {
            setTimeout(function(){
                keyboard.enabled = true;
                keyboard.toggle();
            }, 200);
        }
    })
    // activate the typing extension
    .addTyping({
        showTyping: true,
        delay: 250
    });

});

@Saiberion
Copy link
Author

The keyboard can be over the input because the display is only 800x480 und the displayed wabsite is limited to this size. So If I click a textbox on the bottom of the screen the keyboard expands to the top right.

Anyway the approach with enabled seems like what I need but for some reason my keyboard ignores this attribute and the key stay active even if enabled is set to false in beforeVisible and visible.

@Saiberion
Copy link
Author

The not working enable probably was caused bei version 1.18.12 I used until now.

Now I have to find out why so much white space is added my my custom layout after updating the jquery.keyboard.js.

@Mottie
Copy link
Owner

Mottie commented Feb 1, 2016

I'm guessing this issue has been resolved, so I'm going to close it. If you continue to have problems, please feel free to continue the discussion in this thread.

@Mottie Mottie closed this as completed Feb 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants