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

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

Closed
jeremyckahn opened this issue Sep 10, 2012 · 5 comments
Closed

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

jeremyckahn opened this issue Sep 10, 2012 · 5 comments

Comments

@jeremyckahn
Copy link

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
Copy link
Owner

Mottie commented Sep 10, 2012

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
Copy link
Author

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
Copy link
Owner

Mottie commented Sep 10, 2012

5 minutes :P

@jeremyckahn
Copy link
Author

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

@jeremyckahn
Copy link
Author

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants