Page 1 of 1

Difference between setKeyDown and setPressed?

Posted: Sat Nov 05, 2016 5:01 am
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

Re: Difference between setKeyDown and setPressed?

Posted: Thu Nov 10, 2016 1:40 am
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