A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: key management in flash blows!

  1. #1
    Member
    Join Date
    Sep 2007
    Posts
    80

    key management in flash blows!

    So I've found that if a person presses three keys at once flash only registers 2 of them most of the time. If the combination includes certain keys, like the UP key, then it won't work... is there any viable workaround to this?

    What if someone in my game happens to be pressing up and left at the same time and then wants to shoot with the spacebar... it wont work!! Although I do not have diagonal movement, a player might still do it either by accident or just in preparation for moving up after moving left... this is a BIG problem... anyone have a fix?

    Thanks!
    Kyle

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Moved to games.
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    It's a keyboard issue rather than a Flash one.

    Some keyboards can handle arrow keys and space, some can't. 'Fraid there's no better answer than that ( WASD and space works fine ).

    Squize.

  4. #4
    Senior Member Ray Beez's Avatar
    Join Date
    Jun 2000
    Posts
    2,793
    It's true different keyboards have different "key ghosting" problems, but how do commercial PC games get around this?

  5. #5
    ....he's amazing!!! lesli_felix's Avatar
    Join Date
    Nov 2000
    Location
    London UK
    Posts
    1,506
    I can't think of a commercial game that relies on multiple keypresses... the mouse is nearly always half of the controls anyway.

  6. #6
    ....he's amazing!!! lesli_felix's Avatar
    Join Date
    Nov 2000
    Location
    London UK
    Posts
    1,506
    It could also be that your logic is preventing more than two keys from being registered. I had this problem only this week, with certain cases being excluded from being tested because of a faulty if..then..else chain

    I ended up writing my longest ever single line of actionscript to handle it.

    Check this baby out..
    Code:
    pressed = Key.isDown(Key.UP) ? Key.isDown(Key.RIGHT) ? "NE" : Key.isDown(Key.LEFT) ? "NW" : "N" : Key.isDown(Key.DOWN) ? Key.isDown(Key.RIGHT) ? "SE" : Key.isDown(Key.LEFT) ? "SW" : "S" : Key.isDown(Key.LEFT) ? "W" : Key.isDown(Key.RIGHT) ? "E" : "none";

  7. #7
    Senior Member hatu's Avatar
    Join Date
    Jan 2007
    Posts
    480
    I don't think you can go around it with just software. Try holding down four buttons in any game and it won't work.
    http://hatu.biz
    Portfolio & games

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center