| View previous topic :: View next topic |
| Author |
Message |
aaa666 Guest
|
Posted: Mon Aug 08, 2005 10:45 pm Post subject: Repeat question |
|
|
I need to count the number of times I press down certain keys (among other things), so I wrote:
| Code: | count:=0
~a::key()
~b::key()
~c::key()
;... and so on
key()
{
global
;...some other code here...
count:=count+1
return
} |
The only problem is that when I hold down a key to repeat it (which is a desirable functionality), the count is repeated as well (which is not desirable). How can I execute code only once when a key is pressed down, but still keep the repeat functionality? |
|
| Back to top |
|
 |
Litmus Red
Joined: 25 Jul 2005 Posts: 139 Location: Richmond, Virginia
|
Posted: Tue Aug 09, 2005 1:12 am Post subject: |
|
|
How about this?
| Code: | count:=0
~a up::key()
~b up::key()
~c up::key()
;... and so on
key()
{
global
;...some other code here...
count:=count+1
return
} |
|
|
| Back to top |
|
 |
Guest
|
Posted: Tue Aug 09, 2005 10:37 am Post subject: |
|
|
I missed the obvious solution, thanks! |
|
| Back to top |
|
 |
|