Problem with keyup event 2003-12-11 - By ullala
Back At 8:07 Uhr -0800 11.12.2003, Geng Wang wrote: >There are no problems when you just strok >one key at a time. But if there are more than one key >stroked at the same time, only ONE KeyUp is >identified, whatever key released first.
I like doing the following trick: storing all keys on keyDown in a list, and on keyUp checking which of the keys that are stored in the list are still pressed. Something like this:
property pPressedKeys
on beginSprite me pPressedKeys = [] end
on keyDown me k = the key if getPos(pKeyList, k) = 0 then add pKeyList, k end if end
on keyUp me nr = count(pKeyList) repeat with i = nr down to 1 k = pKeyList[i] if not(keyPressed(k)) then deleteOne(pKeyList, k) end if end repeat end
And maybe its better to store and check charToNum instead of the key itself...
cheers, ullala :-) __ ____ ____ ____ ____ ____ ____ ____ ____ ____ Dir3d-l mailing list Dir3d-l@(protected) http://nuttybar.drama.uga.edu/mailman/listinfo/dir3d-l
|
|