how do i use the keydown command

when i type
if(keydown)(1) it says "Error: Expected format keydown(val)
when i type
if(keydown(1) it says “Error: Expected format: if (flag) command;”

how i fix

Re: how do i use the keydown command

As such, consider it a 'passive flag'. It will not activate the moment the keydown is pressed, it will only be active when the script is being read at that point when its considered true. Eg: in a loop

Re: how do i use the keydown command

in other words you'd have to add it to a timeout in order for it to keep checking if your pressing it often:

if (timeout) {
if (keydown(6)) {doaction;}
timeout =0.05;}

roughly enough hehe

Re: how do i use the keydown command

Just use keypressed,

if(keypressed){
if(keydown(1)){ }
}

Re: how do i use the keydown command

Keypressed is handy, it is indeed an active trigger, but it doesn't trigger for all keys on the keyboard, just a heads up :open_mouth:

Re: how do i use the keydown command

Guess it’s not for me to say but shouldn’t this be in the dev area?