is it possible to actual have two different keydown events such as A to move one picture and left to move another. so holding down A and left will move both pictures...
Printable View
is it possible to actual have two different keydown events such as A to move one picture and left to move another. so holding down A and left will move both pictures...
Welcome to the Forum :wave:Quote:
Originally Posted by Phoenixium
No it is not possible.
nice warming welcome ^_^Quote:
Originally Posted by Shuja Ali
ok thanks
Actually the KeyPress/KeyDown events will fire the moment you press A. You can't press both the keys at the same time, there will be a delay between the key presses.
If what I understood your first post correctly, you want both the pictures to move the moment user presses A and Left Button. Right?
Lol Shuja ...Quote:
Originally Posted by Shuja Ali
Nice one...
Well if your looking to have the images move while a key is pressed, and stops when the key is released..
It can be done with a Timer....
In keydown you set a boolean "True" and keyup you set the Boolean "False" ..
and in the timer event you check the boolean and move the images accordingly...
Check out Crop/Zoom image thread for a example of using timers
Gremmy....
hmm... could do, seems easier that way.
Well i was a bit bored today and decided to tackle this question with a small demo...
Fire it up, select the method of movement, (continous or auto stop)..
and start pressing keys..
Just something to note.. the keyboard cant always handle more than 3 keys press simultaniously, Depending on the scanline you can sometimes get 4 or 5, but generaly it's around 3...
Also when using continous the centre keys, "S" and "J" stop them...
Then because you cant move up and down at the same time i used a custom TriState variable for up/stop/down and left/stop/right ....
enjoy...
Gremmy....
i must say its quite impressive no idea what that Enum is just looking into it now ^_^
Enum is used to create you own data types...
Like boolean is a datatype and can be described with enum as suchAlso usig a Enum (Enumerated) variable is handy as it is called up in intelisence..Code:Enum Boolean
True
False
End Enum
Gremmy