Difference between setKeyDown and setPressed?

Official forum for open source FreePIE discussion and development.
Post Reply
simulondo
One Eyed Hopeful
Posts: 5
Joined: Fri Jul 01, 2016 12:43 pm

Difference between setKeyDown and setPressed?

Post by simulondo »

Hi

What is the difference between this:

Code: Select all

keyboard.setKeyDown(Key.Y)
keyboard.setKeyUp(Key.Y)
...this:

Code: Select all

keyboard.setPressed(Key.Y)
... and this:

Code: Select all

keyboard.setPressed(Key.Y,True)
Maybe the question sounds silly or very basic but I have problems with some old games (some old '90 flight sims) and I'm not sure to understand correctly the function of these senteces.

Thanks in advance

Regards
FrenchyKiel
One Eyed Hopeful
Posts: 47
Joined: Thu Oct 03, 2013 7:10 am

Re: Difference between setKeyDown and setPressed?

Post by FrenchyKiel »

Code: Select all

keyboard.setKeyDown(Key.Y)
keyboard.setKeyUp(Key.Y)
setKeyDown = press key, setKeyUp = release key, you decide when you do this event

Code: Select all

keyboard.setPressed(Key.Y)
this code press and release the key (first turn of script = press, the next = release)

Code: Select all

keyboard.setPressed(Key.Y,bool)
its not True its boolean

this code press and release key only when bool is True (one time)

to rearm the event the bool have to be false and then True
Post Reply

Return to “FreePIE”