jeromeetienne / threex

Game Extensions for three.js
http://www.threejsgames.com/extensions/
MIT License
334 stars 59 forks source link

KeyboardState- Firefox problems, Arrow Keys, Events and Toggles #23

Closed CoryG89 closed 11 years ago

CoryG89 commented 11 years ago

I have had some trouble using the KeyboardState object querying for the arrow keys targeting the Firefox browser. It seems that in Chrome my renderer is set to the size of the window and so there is no scrolling but for some reason the default behavior of the arrow keys causes the window to scroll slightly. This issue can be demonstrated by viewing the demo at the following address in Firefox and pressing the down arrow key.

http://cmg0030.zxq.net/threejs/acclDemo2

It is fixed by using my modified KeyboardState object where I disabled the defaultbehavior within the keyup and keydown events.

http://cmg0030.zxq.net/threejs/acclDemo3