Packagecom.threerings.ui
Classpublic class KeyRepeatLimiter
InheritanceKeyRepeatLimiter Inheritance flash.events.EventDispatcher

A very simple class that adapts the KeyboardEvents generated by some source and altering (or blocking) the key repeat rate.



Protected Properties
 PropertyDefined by
  _down : Dictionary
Tracks whether a key is currently being held down.
KeyRepeatLimiter
  _limitRate : int
KeyRepeatLimiter
  _source : IEventDispatcher
Our source.
KeyRepeatLimiter
Public Methods
 MethodDefined by
  
KeyRepeatLimiter(source:IEventDispatcher, limitRate:int = 0)
Create a KeyRepeatLimiter that will be limiting key repeat events from the specified source.
KeyRepeatLimiter
  
shutdown():void
Dispose of this KeyRepeatBlocker.
KeyRepeatLimiter
Protected Methods
 MethodDefined by
  
handleKeyDown(event:KeyboardEvent):void
KeyRepeatLimiter
  
handleKeyUp(event:KeyboardEvent):void
KeyRepeatLimiter
  
handleTimerEvent(event:TimerEvent):void
KeyRepeatLimiter
Property detail
_downproperty
protected var _down:Dictionary

Tracks whether a key is currently being held down.

_limitRateproperty 
protected var _limitRate:int
_sourceproperty 
protected var _source:IEventDispatcher

Our source.

Constructor detail
KeyRepeatLimiter()constructor
public function KeyRepeatLimiter(source:IEventDispatcher, limitRate:int = 0)

Create a KeyRepeatLimiter that will be limiting key repeat events from the specified source.

Parameters
source:IEventDispatcher — 0 to block all key repeats, or a millisecond value specifying how often to dispatch KEY_DOWN events while the key is being held down. The rate will be limted by the frame rate of the enclosing SWF.
 
limitRate:int (default = 0)
Method detail
handleKeyDown()method
protected function handleKeyDown(event:KeyboardEvent):voidParameters
event:KeyboardEvent
handleKeyUp()method 
protected function handleKeyUp(event:KeyboardEvent):voidParameters
event:KeyboardEvent
handleTimerEvent()method 
protected function handleTimerEvent(event:TimerEvent):voidParameters
event:TimerEvent
shutdown()method 
public function shutdown():void

Dispose of this KeyRepeatBlocker.