BrowserHack icon indicating copy to clipboard operation
BrowserHack copied to clipboard

shift-click also moves

Open freddyb opened this issue 9 years ago • 3 comments

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

freddyb avatar Apr 16 '15 14:04 freddyb

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?

coolwanglu avatar Apr 16 '15 17:04 coolwanglu

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.

freddyb avatar Apr 16 '15 20:04 freddyb

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

coolwanglu avatar Apr 17 '15 00:04 coolwanglu