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

Error: invalid button: 3 #813

Closed
zepumph opened this issue Jun 7, 2018 · 6 comments
Closed

Error: invalid button: 3 #813

zepumph opened this issue Jun 7, 2018 · 6 comments
Assignees
Labels

Comments

@zepumph
Copy link
Member

zepumph commented Jun 7, 2018

I got this error while trying to use my back button on my mouse. I'm not sure how we want to handle this, but I don't think erroring out is ideal. I also go this (with "4") when using the forward button on my mouse. What do you think @jonathanolson. Here is the switch case that is causing issues:

    down: function( point, event ) {
      var pointChanged = this.hasPointChanged( point );
      point && sceneryLog && sceneryLog.InputEvent && sceneryLog.InputEvent( 'mouse down at ' + point.toString() );
      // if ( this.point ) { this.point.freeToPool(); }
      this.point = point;
      this.isDown = true;
      switch( event.button ) {
        case 0:
          this.leftDown = true;
          break;
        case 1:
          this.middleDown = true;
          break;
        case 2:
          this.rightDown = true;
          break;
        default:
          throw new Error( 'invalid button: ' + event.button );
      }
@jonathanolson
Copy link
Contributor

Yup, this is one of the errors that will happen until #803 is fixed. Instead it will record what button numbers are pressed.

@jonathanolson jonathanolson removed their assignment Jun 8, 2018
@zepumph
Copy link
Member Author

zepumph commented Jun 8, 2018

I'm not sure I understand, and maybe I don't need to, but I feel like only recently did using my mouse's back button begin to error out in master. Does this need to error out? Can't we just ignore other mouse buttons and let the browser have them?

@jonathanolson
Copy link
Contributor

We can probably temporarily patch things so it ignores other buttons. Would you recommend that?

@zepumph
Copy link
Member Author

zepumph commented Jun 8, 2018

That sounds really nice! I would appreciate that if it was easy.

@jonathanolson
Copy link
Contributor

Can you see if the above commit fixes this particular thing from erroring out?

@zepumph
Copy link
Member Author

zepumph commented Jun 21, 2018

That's very nice, I appreciate the workaround, as I was hitting this error about 20 times a day. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants