Keys being read on both Up and Down state
by Bryce "Cogburn" Weiner · in Torque Game Engine · 10/07/2004 (7:06 pm) · 4 replies
I've been monkeying with binds and somewhere along the line I've done something I cannot fix.
Each time I press a key that is bound, the bound action occurs on both the keydown and keyup events, rather than one or the other.
I have not conciously done anything to modify this, so I must have goofed up something somewhere.
This problem arose during scripting edits and not as a result of engine modifications.
Any clues as to where to look?
Each time I press a key that is bound, the bound action occurs on both the keydown and keyup events, rather than one or the other.
I have not conciously done anything to modify this, so I must have goofed up something somewhere.
This problem arose during scripting edits and not as a result of engine modifications.
Any clues as to where to look?
#3
02/15/2006 (8:35 pm)
It will not work
#4
When you bind a key to a function, the first paremeter (%val, in the example) is the key state.
02/16/2006 (8:13 am)
Did you declare the %val paremeter in your function, JW?function myFunction(%val) {
if (%val == 1)
//The key is down
if (%val == 0)
//The key is up
}When you bind a key to a function, the first paremeter (%val, in the example) is the key state.
Torque 3D Owner Tim Dix (Raverix)
If (%val == 1) {KEY DOWN}
If (%val == 0) {KEY UP}
Hope this helps
[edit]
By "bind" I mean the function that your key is bound to.
[/edit]