Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Holding a key while closing a Keyboard causes an error #102

Closed
jeremyckahn opened this Issue · 5 comments

2 participants

@jeremyckahn

Steps to reproduce:

  1. Navigate to http://mottie.github.com/Keyboard/basic.html.
  2. Focus the input to instantiate a Keyboard.
  3. Hold any key (such as the alt key), and then hit the Escape key to close the Keyboard (while still holding the first key).
  4. Release all keys.
  5. Observe error at this line.

This was observed in all browsers on Mac OS X 10.7.4.

The erroring code is being called asynchronously from this setTimeout, so it's likely the code is performing an operation on a state it is not expecting.

@Mottie
Owner

Hi jeremyckahn!

Thanks for reporting this issue. It appears that Windows 7 doesn't close the keyboard when using ctrl-esc or alt-esc so I'm not getting any errors. Since I'm about to release a version, I've added the fix below to the setTimeout. Hopefully it will fix the problem. If not, I shall investigate it further.

base.throttled = setTimeout(function(){
    if (base.isVisible()) {
        base.checkCombos();
    }
}, 100);
@jeremyckahn

Thanks for the speedy reply! Yeah, that looks like a sane fix. When will the new version be out? I'm happy to test it.

@Mottie
Owner

5 minutes :P

@jeremyckahn

Just tested it out - the fix works. Thanks again for the fast turnaround!

@jeremyckahn

Also, in case you were curious what I'm using this plugin for, I'm looking to implement it and add some Gamepad API related functionality for my Pine project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.