ulfben icon

isKeyDown

ulfben | PRO | 10/30/15 02:12:13 PM UTC | 0 ⭐ | 11078 👁️ | Never ⏰ | []
ActionScript 3 |

0 B

|

None

|

0 👍

/

0 👎

private var _hash:Object = {};
 
private function onKeyReleased(event:KeyboardEvent):void {
    delete _hash[event.keyCode];
}
 
private function onKeyPressed(event:KeyboardEvent):void {
    _hash[event.keyCode] = 1;
}
 
private function isKeyDown(code:int):Boolean {
    return _hash[code] !== undefined;
}
 
stage.addEventListener(KeyboardEvent.KEY_UP, onKeyReleased);
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyPressed);

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  • Rteuixl icon
    04/02/26 04:31:55 PM UTC
    text |

    0 B

    |

    0 👍

    /

    0 👎

    Best t33n active cpx link daily updates!
     Copy and paste the link in a new browser tab and then hit enter!
     https://crazyporn.@xxx/members/157354/?asgtbndr=1&play=true&spon=adworld&zone=400
     Remove the @ 
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎