Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
I have a strange problem with on-key-down event. When i load a scene from coppercube everything works fine but when i create a scene from scratch, document.on-key-down isnt calling the function which is assosiated with. When i have a FPS camera in my scene, although the camera works with WASD keys i cant handle any other keyboard input. (event.engine.handleKeyDown(event) is in the end of the function ) The only way i found to have keyboard feedback is when i assosiate a function with the on-key-down event in <body> tag. Am i missing something? Is it possible someone to post a working and tested code with a scene (Not loaded from Coppercube) and a camera, that displays e.g an alert when a key is pressed? P.S topic's original title was on-key-down event. Forum cut it. Also i use the - to seperate the name of the event in order not to cut it again. |
||||
|
How are you registering the on-key-down event? Maybe you are registering it before you initialize CopperLicht and CopperLicht then simply overwrites yours. Try to call something like document.on-key-down = function(event){me.handleKeyDown(event)};after CopperLicht is initialized, then it should work. Sorry about the forum. Going to do something about this. |
||||
|
It worked. I was registering it before Copperlicht. Thanks! |
||||
|
|