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

shift-click also moves #8

Open
freddyb opened this issue Apr 16, 2015 · 3 comments
Open

shift-click also moves #8

freddyb opened this issue Apr 16, 2015 · 3 comments

Comments

@freddyb
Copy link

freddyb commented Apr 16, 2015

Shift-clicking on tile also moves my current character. I just looked into both mouse_event_handler (line 747) and the shift-click event listener (line 782, both win/web/nethack_lib.js) but judging from the early return statements, I couldnt find the root cause..

Again, this is on Firefox

@coolwanglu
Copy link
Owner

I think I've fixed this in a commit, but not sure if you were reporting before or after it.
https://github.com/coolwanglu/BrowserHack/blob/master/win/web/nethack_lib.js#L749
Basically while handling click events, if shiftKey is true, the event will be just ignored.

Can you try the latest version again?

@freddyb
Copy link
Author

freddyb commented Apr 16, 2015

You're right! It doesn't move anymore - but now I sometimes select text when shift-clicking.

Steps to reproduce:

  • Single-click on some text (the big "BrowserHack" title or some text in the game log)
  • shift-click an exciting tile
  • observe how the text between your first click and the tile is selected

Of course this doesn't reproduce if you've clicked somewhere on the tiles before - but I'm a heavy keyboard user and seldomly click on the map.

@coolwanglu
Copy link
Owner

Yes, I can reproduce it, not sure what to do thought. Maybe I need to intercept mousedown and call preventDefault

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