Here's the method I use in most of my programs, it allows for Press, Hold, and release of keys.
The following example is for the right-mouse button.
rmb = 0
Do
If MouseClick() = 2 : If rmb = 0
`** On MouseDown **
rmb = 1
Cls RGB(255,255,255)
Else
`** While MouseHeld **
Cls RGB(100,0,255)
EndIf : Else : If rmb = 1
`** On MouseUp **
rmb = 0
Cls RGB(255,0,0)
EndIf : EndIf
Sync
Loop
To use it for different keys, just change the first line to something like:
If LeftKey() = 1
etc.
And for each new key you add, just put in a new variable up top to hold the press state, and change the variable in the code
Jess.
Team EOD :: Programmer/All-Round Nice Guy
Aust. Convention!