Keypress event triggered twice

  • Marte2007
    26th Aug 2011 Member 0 Permalink
    I found that the keypress event (tpt.register_keypress) is triggered twice, one for key down and one for key up, without any different parameter. How can I use this once? It must toggle a boolean variable, but this problem makes it to turn on then off the var.
  • mniip
    26th Aug 2011 Developer 0 Permalink
    Tpt.register_keyevent returns 4th param
    look at it
  • Simon
    26th Aug 2011 Administrator 0 Permalink
    There's a 4th parameter, "event", an integer which identifies the event type (1 for down, 2 for up, I think)
  • Marte2007
    26th Aug 2011 Member 0 Permalink
    Thanks, it worked