• Hey! Guest! The 40th (!!!) GMC Jam will take place between February 25th, 12:00 UTC to March 1st 12:00 UTC. Why not join in this very special anniversary jam! Click here to find out more!

Windows how to get keY DOWN frequenc?


i wan to make plane game.if i fast key down.the plane fast shoot .if i slow key down.the plane slow shoot.
i think if i can get keY DOWN frequenc.it is easy design code.but i do not know how to get keY DOWN frequenc
who can help me? thank you!


Kazan Games
It is not possible to detect the "frequency" of pressing the key, the key only returns binary value 1 and 0 (true and false).

What you can do is create a time variable, if the key is pressed you reset the time, if you continue pressing it will increase the variable until it reaches a certain value (which is the time), so you will shoot and reset the time again.


[QUOTE =“ FoxyOfJungle,帖子:480242,成员:31608”]

Can you give code.thank you.