I'm trying to add an area of the UI to display something with scrolling, but while scrolling with the mousewheel, the main window zooms too. I've tried various methods to prevent the main window from also zooming (.addEventListener, .bind, onmousewheel, mousewheel, and pretty much anything I could google), but none of them are working. My current attempt is as follows. The debugger does not show any errors. Code: $("#test_div").bind('mousewheel', function(e, d) {e.preventDefault();}); Anyone tried/know how to do this?
I'm pretty sure the zooming is currently done in the engine and not though a javascript mouse bind? Although I'll double check this later. I think I've seen an engine call to disable and re-enable key actions, this might do it. Again I'll report back if you haven't found it already by the time I do.
yeah also when sending messages, moving up down left and right through the text you're typing will make the planet move. it's silly.
I found this in shared/js/console.js Code: api.game.captureKeyboard(); api.game.releaseKeyboard(); This seems to do the trick for the mouse wheel which is what you need, but not for the left and right keys like tatsujb says... which is a bit strange.
The arrow keys are one of the last things that need to move into JS. Kevin was working on this but has been distracted by perf issues.