Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-25-2007, 11:12 PM
DrakilorP2P DrakilorP2P is offline
Registered User
DrakilorP2P's Avatar
Join Date: Apr 2006
Posts: 755
DrakilorP2P is just really niceDrakilorP2P is just really nice
Keydown event? (Not onKeyPressed)

I'm trying to find a way to detect when a key is pushed down, and not when it's pressed (onKeyPressed). The effect would basically be the same as onKeyPressed, but without the auto-repeat most operating systems implements.

From searching the forums, I've found that onKeyDown and onKeyUp apparently can be used in GUI controls, but none of them works in a standard "weapon". (Declaring onKeyUp() and KeyUp())

My goal is to call a function when a key is tapped twice within a specified timespan. At first I did this with onKeyPressed and timevar2, but previously mentioned auto-repeat messed that up, calling the function repeatedly when the button was held down.

As an alternative, I thought about checking for the keys in onTimeout(), but the way I constructed it, it would limit the timespan to a minimum of 0.1. (Not allowing the player to double press faster than that)
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:32 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.