Packageverlocity.components
Classpublic final class verInput
InheritanceverInput Inheritance Component Inheritance Singleton Inheritance Object

Keyboard and mouse input handling. Supports various useful features such as force focusing, key combos, double tapping, key history, triggered, released, and more.



Public Properties
 PropertyDefined By
 InheritedclassName : Object
[read-only] Returns the class name of the component for dictionary registration.
Component
  Mx : Number
[read-only] Returns the current mouse x position.
verInput
  My : Number
[read-only] Returns the current mouse y position.
verInput
Protected Properties
 PropertyDefined By
 Inheritedstage : Stage
Component
Public Methods
 MethodDefined By
  
verInput(sStage:Stage)
Constructor of the component.
verInput
  
_Destruct():void
[override] Destructor of the component.
verInput
 Inherited
_IsNotUpdating():Boolean
Returns if the component is not updating (paused).
Component
 Inherited
_IsValid():Boolean
Returns if this singleton is active/valid.
Singleton
 Inherited
_SetUpdating(bUpdating:Boolean):void
Pauses/resumes the component updating, if it's pausable.
Component
 Inherited
Updates the component, if possible.
Component
  
Clears the entire key history.
verInput
  
EnableKeys(bEnabled:Boolean = true):void
Enables/disables the keyboard input.
verInput
  
EnableMouse(bEnabled:Boolean = true):void
Enables/disables the mouse input.
verInput
  
Focus(inter:InteractiveObject):void
Forces keyboard focus on a specific nteractive object.
verInput
  
ForceFocus():void
Forces keyboard focus on the stage.
verInput
  
Returns the key history array.
verInput
  
IsAltDown():Boolean
Returns if the alt key is held down.
verInput
  
IsControlDown():Boolean
Returns if the control key is held down.
verInput
  
IsKeyEnabled():Boolean
Returns if the key input is enabled.
verInput
  
IsMouseEnabled():Boolean
Returns if the mouse input is enabled.
verInput
  
IsShiftDown():Boolean
Returns if the shift key is held down.
verInput
  
KeyCombo(aKeyCombo:Array):Boolean
Returns if a sequential key combo was pressed.
verInput
  
KeyIsDoubleTapped(keyCode:*):Boolean
Returns if a key was double tapped.
verInput
  
KeyIsDown(keyCode:*):Boolean
Returns if a key is currently down/pressed.
verInput
  
KeyIsReleased(keyCode:*):Boolean
Returns if a key was released.
verInput
  
KeyIsTriggered(keyCode:*):Boolean
Returns if a key was triggered (pressed once, not held).
verInput
  
MouseIsDown():Boolean
Returns if the left mouse button is down.
verInput
  
MouseIsInside(disp:DisplayObject):Boolean
Returns if the mouse is inside a dispay object.
verInput
  
MouseWheel():Number
Returns the current mouse wheel delta.
verInput
  
ShowMouse(bShow:Boolean = true):void
Shows/hides the mouse cursor.
verInput
Protected Methods
 MethodDefined By
 Inherited
Called if verConsole is enabled, used to create concommands for the component.
Component
  
_Update():void
[override] Stores the last pressed keys for later reference.
verInput
Property Detail
Mxproperty
Mx:Number  [read-only]

Returns the current mouse x position.


Implementation
    public function get Mx():Number
Myproperty 
My:Number  [read-only]

Returns the current mouse y position.


Implementation
    public function get My():Number
Constructor Detail
verInput()Constructor
public function verInput(sStage:Stage)

Constructor of the component.

Parameters
sStage:Stage
Method Detail
_Destruct()method
override public function _Destruct():void

Destructor of the component.

_Update()method 
override protected function _Update():void

Stores the last pressed keys for later reference.

ClearKeyHistory()method 
public final function ClearKeyHistory():void

Clears the entire key history.

EnableKeys()method 
public final function EnableKeys(bEnabled:Boolean = true):void

Enables/disables the keyboard input.

Parameters

bEnabled:Boolean (default = true) — Should the key input be enabled?

EnableMouse()method 
public final function EnableMouse(bEnabled:Boolean = true):void

Enables/disables the mouse input.

Parameters

bEnabled:Boolean (default = true) — Should the mouse input be enabled?

Focus()method 
public final function Focus(inter:InteractiveObject):void

Forces keyboard focus on a specific nteractive object.

Parameters

inter:InteractiveObject — The interactive object

ForceFocus()method 
public final function ForceFocus():void

Forces keyboard focus on the stage. This occurs each state change.

GetKeyHistory()method 
public final function GetKeyHistory():Array

Returns the key history array.

Returns
Array
IsAltDown()method 
public final function IsAltDown():Boolean

Returns if the alt key is held down.

Returns
Boolean
IsControlDown()method 
public final function IsControlDown():Boolean

Returns if the control key is held down.

Returns
Boolean
IsKeyEnabled()method 
public final function IsKeyEnabled():Boolean

Returns if the key input is enabled.

Returns
Boolean
IsMouseEnabled()method 
public final function IsMouseEnabled():Boolean

Returns if the mouse input is enabled.

Returns
Boolean
IsShiftDown()method 
public final function IsShiftDown():Boolean

Returns if the shift key is held down.

Returns
Boolean
KeyCombo()method 
public final function KeyCombo(aKeyCombo:Array):Boolean

Returns if a sequential key combo was pressed. Array must be a list of uint keyCodes! Must be in the order the combo should be pressed in.

Parameters

aKeyCombo:Array — The array containing the key combo.

Returns
Boolean
KeyIsDoubleTapped()method 
public final function KeyIsDoubleTapped(keyCode:*):Boolean

Returns if a key was double tapped.

Parameters

keyCode:* — The key either uint keyCode or String (for registered hotkeys)

Returns
Boolean
KeyIsDown()method 
public final function KeyIsDown(keyCode:*):Boolean

Returns if a key is currently down/pressed.

Parameters

keyCode:* — The key either uint keyCode or String (for registered hotkeys)

Returns
Boolean
KeyIsReleased()method 
public final function KeyIsReleased(keyCode:*):Boolean

Returns if a key was released.

Parameters

keyCode:* — The key either uint keyCode or String (for registered hotkeys)

Returns
Boolean
KeyIsTriggered()method 
public final function KeyIsTriggered(keyCode:*):Boolean

Returns if a key was triggered (pressed once, not held).

Parameters

keyCode:* — The key either uint keyCode or String (for registered hotkeys)

Returns
Boolean
MouseIsDown()method 
public final function MouseIsDown():Boolean

Returns if the left mouse button is down.

Returns
Boolean
MouseIsInside()method 
public final function MouseIsInside(disp:DisplayObject):Boolean

Returns if the mouse is inside a dispay object.

Parameters

disp:DisplayObject — The display object

Returns
Boolean
MouseWheel()method 
public final function MouseWheel():Number

Returns the current mouse wheel delta.

Returns
Number
ShowMouse()method 
public final function ShowMouse(bShow:Boolean = true):void

Shows/hides the mouse cursor.

Parameters

bShow:Boolean (default = true) — Should the mouse cursor be visible?