Mailing List
Home
Forum Home
Softimage
Carrara
trueSpace
Dir3d-l
Maya - a powerful 3D animation and visual effects software
Macromedia Flash Development
Subjects
Cameras
scaleDown command
black out solved
Aircraft Tutorial
Mathematical XYZ ?
Its done This vs That
Its done first week
recommendations for screen video captures?
3DExplorer "Oddity "
New Director
ProTeam renewals
Fuel 's new websites (X post)
Blue peter create a make toy
targeting groups question
XPost: Shockwave 3D game ( sort of )
RES: RES: RES: Fish Modeling
Emitting particles from object intersection
Fuel 's new websites (X post)
Texturing
Big Break Contest Videos
New Plugins
Models and Texture on my updated site
Error Installing Patch tS6 6
Plasma?
Looking for Inspiration
Weird EMail Q
It 's done first week ?
Cherry not cranberry
New game
Camera Animation Problem
Particle plugins?
 
Problem with keyup event

Problem with keyup event

2003-12-11       - By ullala

 Back
Reply:     1     2     3     4     5     6     7     8  

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