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

Two hotkey presses needed after J+H hotkey #186

Closed
zepumph opened this issue Nov 5, 2019 · 4 comments
Closed

Two hotkey presses needed after J+H hotkey #186

zepumph opened this issue Nov 5, 2019 · 4 comments

Comments

@zepumph
Copy link
Member

zepumph commented Nov 5, 2019

From #141, and #138.

The bug is outlined in #138 (comment):

@terracoda noticed that sometimes you have to press the hot keys more than once to get them to fire. For example in the following sequence, I reliably needed to press "J + C" twice, only the second time did it move:

J+C
J+C
J+H
Enter (to grab again)

zepumph added a commit to phetsims/scenery-phet that referenced this issue Nov 5, 2019
zepumph added a commit to phetsims/scenery that referenced this issue Nov 5, 2019
zepumph added a commit to phetsims/scenery that referenced this issue Nov 5, 2019
zepumph added a commit to phetsims/scenery that referenced this issue Nov 5, 2019
zepumph added a commit to phetsims/balloons-and-static-electricity that referenced this issue Nov 5, 2019
zepumph added a commit to phetsims/inverse-square-law-common that referenced this issue Nov 5, 2019
zepumph added a commit to phetsims/scenery that referenced this issue Nov 5, 2019
zepumph added a commit to phetsims/scenery that referenced this issue Nov 5, 2019
@zepumph
Copy link
Member Author

zepumph commented Nov 5, 2019

After investigation with @jessegreenberg, we found that this had to do with how the J+H hotkey was calling "releaseDraggable" but needed to interrupt the KeyboardDragListener as a part of that. Furthermore, we were resetting the timer after the hotkey callback, so even though the interrupt was working as expecting and resetting the timer back to the threshold value (to fire immediately after next hotkey press), the timer/counter was then put back to zero afterwards.

On top of this, I added to this issue a few documentation, refactors, and renames. @jessegreenberg, though we worked on most of these, will you look through and see what you think?

@terracoda
Copy link
Contributor

Seems like it is fixed to me. Thanks @zepumph.

@jessegreenberg
Copy link
Contributor

Reviewed the above commits and everything looks like a nice improvement, thanks @zepumph.

@zepumph
Copy link
Member Author

zepumph commented Nov 6, 2019

Thanks!

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

3 participants