Packageflare.system
Classpublic class Input3D
InheritanceInput3D Inheritance Object

The Input3D class manages keyboard and mouse inputs.

Download example - 05 - keyboard input.zip



Public Properties
 PropertyDefined By
  delta : int
[static] Returns a count of the number of detents the mouse wheel has rotated.
Input3D
  doubleClickEnabled : Boolean
[static] Returns or sets whether the double-click detection mode is enabled.
Input3D
  downs : Array
[static] [read-only]
Input3D
  enableEventPhase : Boolean = true
[static]
Input3D
  eventPhase : uint
[static]
Input3D
  hits : Array
[static] [read-only]
Input3D
  keyCode : int
[static] [read-only] Returns the key code of the last pressed key.
Input3D
  middleMouseDown : int
[static] [read-only] Returns a number greater than zero if the mouse button is pressed.
Input3D
  middleMouseHit : int
[static] [read-only] Returns a number greater than zero if the mouse button has been pressed.
Input3D
  middleMouseUp : int
[static] [read-only] Returns a number greater than zero when the mouse button is released after clicking.
Input3D
  mouseDoubleClick : int
[static] [read-only] Returns a number greater than zero if the mouse button has been double clicked.
Input3D
  mouseDown : int
[static] [read-only] Returns a number greater than zero if the mouse button is pressed.
Input3D
  mouseHit : int
[static] [read-only] Returns a number greater than zero if the mouse button has been pressed.
Input3D
  mouseMoved : Number
[static] [read-only] Returns whatever the mouse was moved.
Input3D
  mouseUp : int
[static] [read-only] Returns a number greater than zero when the mouse button is released after clicking.
Input3D
  mouseX : Number
[static] Returns the position of the mouse on the X axis.
Input3D
  mouseXSpeed : Number
[static] [read-only] Returns the displacement of the mouse on the X axis starting from the position of the last frame.
Input3D
  mouseY : Number
[static] Returns the position of the mouse on the Y axis.
Input3D
  mouseYSpeed : Number
[static] [read-only] Returns the displacement of the mouse on the Y axis starting from the position of the last frame.
Input3D
  rightClickEnabled : Boolean
[static] Returns or sets whether the right-click detection mode is enabled.
Input3D
  rightMouseDown : int
[static] [read-only] Returns a number greater than zero if the mouse button is pressed.
Input3D
  rightMouseHit : int
[static] [read-only] Returns a number greater than zero if the mouse button has been pressed.
Input3D
  rightMouseUp : int
[static] [read-only] Returns a number greater than zero when the mouse button is released after clicking.
Input3D
  stage : Stage
[static] [read-only]
Input3D
Public Methods
 MethodDefined By
  
deactivate():void
[static]
Input3D
  
dispose():void
[static]
Input3D
  
initialize(stage:Stage):void
[static] Initializes the Input3D class.
Input3D
  
keyDown(keyCode:int):Boolean
[static] Returns 'true' all the time the specified key is being pressed.
Input3D
  
keyHit(keyCode:int):Boolean
[static] Returns 'true' if the specified key has been pressed.
Input3D
  
keyUp(keyCode:int):Boolean
[static]
Input3D
  
reset():void
[static] Resets all Input states.
Input3D
  
update():void
[static] Updates keyboard and mouse inputs.
Input3D
Public Constants
 ConstantDefined By
  A : uint = 65
[static]
Input3D
  ALTERNATE : uint = 18
[static]
Input3D
  B : uint = 66
[static]
Input3D
  BACKQUOTE : uint = 192
[static]
Input3D
  BACKSLASH : uint = 220
[static]
Input3D
  BACKSPACE : uint = 8
[static]
Input3D
  C : uint = 67
[static]
Input3D
  CAPS_LOCK : uint = 20
[static]
Input3D
  COMMA : uint = 188
[static]
Input3D
  COMMAND : uint = 19
[static]
Input3D
  CONTROL : uint = 17
[static]
Input3D
  D : uint = 68
[static]
Input3D
  DELETE : uint = 46
[static]
Input3D
  DOWN : uint = 40
[static]
Input3D
  E : uint = 69
[static]
Input3D
  END : uint = 35
[static]
Input3D
  ENTER : uint = 13
[static]
Input3D
  EQUAL : uint = 187
[static]
Input3D
  ESCAPE : uint = 27
[static]
Input3D
  F : uint = 70
[static]
Input3D
  F1 : uint = 112
[static]
Input3D
  F10 : uint = 121
[static]
Input3D
  F11 : uint = 122
[static]
Input3D
  F12 : uint = 123
[static]
Input3D
  F13 : uint = 124
[static]
Input3D
  F14 : uint = 125
[static]
Input3D
  F15 : uint = 126
[static]
Input3D
  F2 : uint = 113
[static]
Input3D
  F3 : uint = 114
[static]
Input3D
  F4 : uint = 115
[static]
Input3D
  F5 : uint = 116
[static]
Input3D
  F6 : uint = 117
[static]
Input3D
  F7 : uint = 118
[static]
Input3D
  F8 : uint = 119
[static]
Input3D
  F9 : uint = 120
[static]
Input3D
  G : uint = 71
[static]
Input3D
  H : uint = 72
[static]
Input3D
  HOME : uint = 36
[static]
Input3D
  I : uint = 73
[static]
Input3D
  INSERT : uint = 45
[static]
Input3D
  J : uint = 74
[static]
Input3D
  K : uint = 75
[static]
Input3D
  L : uint = 76
[static]
Input3D
  LEFT : uint = 37
[static]
Input3D
  LEFTBRACKET : uint = 219
[static]
Input3D
  M : uint = 77
[static]
Input3D
  MINUS : uint = 189
[static]
Input3D
  N : uint = 78
[static]
Input3D
  NUMBER_0 : uint = 48
[static]
Input3D
  NUMBER_1 : uint = 49
[static]
Input3D
  NUMBER_2 : uint = 50
[static]
Input3D
  NUMBER_3 : uint = 51
[static]
Input3D
  NUMBER_4 : uint = 52
[static]
Input3D
  NUMBER_5 : uint = 53
[static]
Input3D
  NUMBER_6 : uint = 54
[static]
Input3D
  NUMBER_7 : uint = 55
[static]
Input3D
  NUMBER_8 : uint = 56
[static]
Input3D
  NUMBER_9 : uint = 57
[static]
Input3D
  NUMPAD : uint = 21
[static]
Input3D
  NUMPAD_0 : uint = 96
[static]
Input3D
  NUMPAD_1 : uint = 97
[static]
Input3D
  NUMPAD_2 : uint = 98
[static]
Input3D
  NUMPAD_3 : uint = 99
[static]
Input3D
  NUMPAD_4 : uint = 100
[static]
Input3D
  NUMPAD_5 : uint = 101
[static]
Input3D
  NUMPAD_6 : uint = 102
[static]
Input3D
  NUMPAD_7 : uint = 103
[static]
Input3D
  NUMPAD_8 : uint = 104
[static]
Input3D
  NUMPAD_9 : uint = 105
[static]
Input3D
  NUMPAD_ADD : uint = 107
[static]
Input3D
  NUMPAD_DECIMAL : uint = 110
[static]
Input3D
  NUMPAD_DIVIDE : uint = 111
[static]
Input3D
  NUMPAD_ENTER : uint = 108
[static]
Input3D
  NUMPAD_MULTIPLY : uint = 106
[static]
Input3D
  NUMPAD_SUBTRACT : uint = 109
[static]
Input3D
  O : uint = 79
[static]
Input3D
  P : uint = 80
[static]
Input3D
  PAGE_DOWN : uint = 34
[static]
Input3D
  PAGE_UP : uint = 33
[static]
Input3D
  PERIOD : uint = 190
[static]
Input3D
  Q : uint = 81
[static]
Input3D
  QUOTE : uint = 222
[static]
Input3D
  R : uint = 82
[static]
Input3D
  RIGHT : uint = 39
[static]
Input3D
  RIGHTBRACKET : uint = 221
[static]
Input3D
  S : uint = 83
[static]
Input3D
  SEMICOLON : uint = 186
[static]
Input3D
  SHIFT : uint = 16
[static]
Input3D
  SLASH : uint = 191
[static]
Input3D
  SPACE : uint = 32
[static]
Input3D
  T : uint = 84
[static]
Input3D
  TAB : uint = 9
[static]
Input3D
  U : uint = 85
[static]
Input3D
  UP : uint = 38
[static]
Input3D
  V : uint = 86
[static]
Input3D
  W : uint = 87
[static]
Input3D
  X : uint = 88
[static]
Input3D
  Y : uint = 89
[static]
Input3D
  Z : uint = 90
[static]
Input3D
Property Detail
deltaproperty
delta:int

Returns a count of the number of detents the mouse wheel has rotated.


Implementation
    public static function get delta():int
    public static function set delta(value:int):void
doubleClickEnabledproperty 
doubleClickEnabled:Boolean

Returns or sets whether the double-click detection mode is enabled. The default value is 'false'.


Implementation
    public static function get doubleClickEnabled():Boolean
    public static function set doubleClickEnabled(value:Boolean):void
downsproperty 
downs:Array  [read-only]


Implementation
    public static function get downs():Array
enableEventPhaseproperty 
public static var enableEventPhase:Boolean = true

eventPhaseproperty 
public static var eventPhase:uint

hitsproperty 
hits:Array  [read-only]


Implementation
    public static function get hits():Array
keyCodeproperty 
keyCode:int  [read-only]

Returns the key code of the last pressed key.


Implementation
    public static function get keyCode():int
middleMouseDownproperty 
middleMouseDown:int  [read-only]

Returns a number greater than zero if the mouse button is pressed.


Implementation
    public static function get middleMouseDown():int
middleMouseHitproperty 
middleMouseHit:int  [read-only]

Returns a number greater than zero if the mouse button has been pressed.


Implementation
    public static function get middleMouseHit():int
middleMouseUpproperty 
middleMouseUp:int  [read-only]

Returns a number greater than zero when the mouse button is released after clicking.


Implementation
    public static function get middleMouseUp():int
mouseDoubleClickproperty 
mouseDoubleClick:int  [read-only]

Returns a number greater than zero if the mouse button has been double clicked.


Implementation
    public static function get mouseDoubleClick():int
mouseDownproperty 
mouseDown:int  [read-only]

Returns a number greater than zero if the mouse button is pressed.


Implementation
    public static function get mouseDown():int
mouseHitproperty 
mouseHit:int  [read-only]

Returns a number greater than zero if the mouse button has been pressed.


Implementation
    public static function get mouseHit():int
mouseMovedproperty 
mouseMoved:Number  [read-only]

Returns whatever the mouse was moved.


Implementation
    public static function get mouseMoved():Number
mouseUpproperty 
mouseUp:int  [read-only]

Returns a number greater than zero when the mouse button is released after clicking.


Implementation
    public static function get mouseUp():int
mouseXproperty 
mouseX:Number

Returns the position of the mouse on the X axis.


Implementation
    public static function get mouseX():Number
    public static function set mouseX(value:Number):void
mouseXSpeedproperty 
mouseXSpeed:Number  [read-only]

Returns the displacement of the mouse on the X axis starting from the position of the last frame.


Implementation
    public static function get mouseXSpeed():Number
mouseYproperty 
mouseY:Number

Returns the position of the mouse on the Y axis.


Implementation
    public static function get mouseY():Number
    public static function set mouseY(value:Number):void
mouseYSpeedproperty 
mouseYSpeed:Number  [read-only]

Returns the displacement of the mouse on the Y axis starting from the position of the last frame.


Implementation
    public static function get mouseYSpeed():Number
rightClickEnabledproperty 
rightClickEnabled:Boolean

Returns or sets whether the right-click detection mode is enabled. The default value is 'false'.


Implementation
    public static function get rightClickEnabled():Boolean
    public static function set rightClickEnabled(value:Boolean):void
rightMouseDownproperty 
rightMouseDown:int  [read-only]

Returns a number greater than zero if the mouse button is pressed.


Implementation
    public static function get rightMouseDown():int
rightMouseHitproperty 
rightMouseHit:int  [read-only]

Returns a number greater than zero if the mouse button has been pressed.


Implementation
    public static function get rightMouseHit():int
rightMouseUpproperty 
rightMouseUp:int  [read-only]

Returns a number greater than zero when the mouse button is released after clicking.


Implementation
    public static function get rightMouseUp():int
stageproperty 
stage:Stage  [read-only]


Implementation
    public static function get stage():Stage
Method Detail
deactivate()method
public static function deactivate():void

dispose()method 
public static function dispose():void

initialize()method 
public static function initialize(stage:Stage):void

Initializes the Input3D class. This method is automatically called when a new scene is created.

Parameters

stage:Stage — Stage container object.

keyDown()method 
public static function keyDown(keyCode:int):Boolean

Returns 'true' all the time the specified key is being pressed.

Parameters

keyCode:int — Code of the key to be tested.

Returns
Boolean — 'true' if it is pressed.

See also

keyHit()method 
public static function keyHit(keyCode:int):Boolean

Returns 'true' if the specified key has been pressed. Unlike the keyDown method, this method will return 'true' only in the first test. Then it will return 'false' until the key is released, thus avoiding repetitions.

Parameters

keyCode:int — Code of the key to be tested.

Returns
Boolean — 'true' if it is pressed.

See also

keyUp()method 
public static function keyUp(keyCode:int):Boolean

Parameters

keyCode:int

Returns
Boolean
reset()method 
public static function reset():void

Resets all Input states.

update()method 
public static function update():void

Updates keyboard and mouse inputs. This method is automatically called by the scene.

Constant Detail
AConstant
public static const A:uint = 65

ALTERNATEConstant 
public static const ALTERNATE:uint = 18

BConstant 
public static const B:uint = 66

BACKQUOTEConstant 
public static const BACKQUOTE:uint = 192

BACKSLASHConstant 
public static const BACKSLASH:uint = 220

BACKSPACEConstant 
public static const BACKSPACE:uint = 8

CConstant 
public static const C:uint = 67

CAPS_LOCKConstant 
public static const CAPS_LOCK:uint = 20

COMMAConstant 
public static const COMMA:uint = 188

COMMANDConstant 
public static const COMMAND:uint = 19

CONTROLConstant 
public static const CONTROL:uint = 17

DConstant 
public static const D:uint = 68

DELETEConstant 
public static const DELETE:uint = 46

DOWNConstant 
public static const DOWN:uint = 40

EConstant 
public static const E:uint = 69

ENDConstant 
public static const END:uint = 35

ENTERConstant 
public static const ENTER:uint = 13

EQUALConstant 
public static const EQUAL:uint = 187

ESCAPEConstant 
public static const ESCAPE:uint = 27

FConstant 
public static const F:uint = 70

F1Constant 
public static const F1:uint = 112

F10Constant 
public static const F10:uint = 121

F11Constant 
public static const F11:uint = 122

F12Constant 
public static const F12:uint = 123

F13Constant 
public static const F13:uint = 124

F14Constant 
public static const F14:uint = 125

F15Constant 
public static const F15:uint = 126

F2Constant 
public static const F2:uint = 113

F3Constant 
public static const F3:uint = 114

F4Constant 
public static const F4:uint = 115

F5Constant 
public static const F5:uint = 116

F6Constant 
public static const F6:uint = 117

F7Constant 
public static const F7:uint = 118

F8Constant 
public static const F8:uint = 119

F9Constant 
public static const F9:uint = 120

GConstant 
public static const G:uint = 71

HConstant 
public static const H:uint = 72

HOMEConstant 
public static const HOME:uint = 36

IConstant 
public static const I:uint = 73

INSERTConstant 
public static const INSERT:uint = 45

JConstant 
public static const J:uint = 74

KConstant 
public static const K:uint = 75

LConstant 
public static const L:uint = 76

LEFTConstant 
public static const LEFT:uint = 37

LEFTBRACKETConstant 
public static const LEFTBRACKET:uint = 219

MConstant 
public static const M:uint = 77

MINUSConstant 
public static const MINUS:uint = 189

NConstant 
public static const N:uint = 78

NUMBER_0Constant 
public static const NUMBER_0:uint = 48

NUMBER_1Constant 
public static const NUMBER_1:uint = 49

NUMBER_2Constant 
public static const NUMBER_2:uint = 50

NUMBER_3Constant 
public static const NUMBER_3:uint = 51

NUMBER_4Constant 
public static const NUMBER_4:uint = 52

NUMBER_5Constant 
public static const NUMBER_5:uint = 53

NUMBER_6Constant 
public static const NUMBER_6:uint = 54

NUMBER_7Constant 
public static const NUMBER_7:uint = 55

NUMBER_8Constant 
public static const NUMBER_8:uint = 56

NUMBER_9Constant 
public static const NUMBER_9:uint = 57

NUMPADConstant 
public static const NUMPAD:uint = 21

NUMPAD_0Constant 
public static const NUMPAD_0:uint = 96

NUMPAD_1Constant 
public static const NUMPAD_1:uint = 97

NUMPAD_2Constant 
public static const NUMPAD_2:uint = 98

NUMPAD_3Constant 
public static const NUMPAD_3:uint = 99

NUMPAD_4Constant 
public static const NUMPAD_4:uint = 100

NUMPAD_5Constant 
public static const NUMPAD_5:uint = 101

NUMPAD_6Constant 
public static const NUMPAD_6:uint = 102

NUMPAD_7Constant 
public static const NUMPAD_7:uint = 103

NUMPAD_8Constant 
public static const NUMPAD_8:uint = 104

NUMPAD_9Constant 
public static const NUMPAD_9:uint = 105

NUMPAD_ADDConstant 
public static const NUMPAD_ADD:uint = 107

NUMPAD_DECIMALConstant 
public static const NUMPAD_DECIMAL:uint = 110

NUMPAD_DIVIDEConstant 
public static const NUMPAD_DIVIDE:uint = 111

NUMPAD_ENTERConstant 
public static const NUMPAD_ENTER:uint = 108

NUMPAD_MULTIPLYConstant 
public static const NUMPAD_MULTIPLY:uint = 106

NUMPAD_SUBTRACTConstant 
public static const NUMPAD_SUBTRACT:uint = 109

OConstant 
public static const O:uint = 79

PConstant 
public static const P:uint = 80

PAGE_DOWNConstant 
public static const PAGE_DOWN:uint = 34

PAGE_UPConstant 
public static const PAGE_UP:uint = 33

PERIODConstant 
public static const PERIOD:uint = 190

QConstant 
public static const Q:uint = 81

QUOTEConstant 
public static const QUOTE:uint = 222

RConstant 
public static const R:uint = 82

RIGHTConstant 
public static const RIGHT:uint = 39

RIGHTBRACKETConstant 
public static const RIGHTBRACKET:uint = 221

SConstant 
public static const S:uint = 83

SEMICOLONConstant 
public static const SEMICOLON:uint = 186

SHIFTConstant 
public static const SHIFT:uint = 16

SLASHConstant 
public static const SLASH:uint = 191

SPACEConstant 
public static const SPACE:uint = 32

TConstant 
public static const T:uint = 84

TABConstant 
public static const TAB:uint = 9

UConstant 
public static const U:uint = 85

UPConstant 
public static const UP:uint = 38

VConstant 
public static const V:uint = 86

WConstant 
public static const W:uint = 87

XConstant 
public static const X:uint = 88

YConstant 
public static const Y:uint = 89

ZConstant 
public static const Z:uint = 90