ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperLicht
forum topic indicator event
person icon
pavlost
Registered User
Quote
2010-05-30 17:25:21

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.

person icon
niko
Moderator
Quote
2010-05-31 16:15:27

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. emoji icon_grin

person icon
pavlost
Registered User
Quote
2010-05-31 23:14:08

It worked. I was registering it before Copperlicht. Thanks!


Create reply:










 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






Copyright© Ambiera e.U. all rights reserved.
Contact | Imprint | Products | Privacy Policy | Terms and Conditions |