/
Input.html
86 lines (72 loc) · 17.7 KB
/
Input.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!-- saved from url=(0014)about:internet --><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><link rel="stylesheet" href="../../../../style.css" type="text/css" media="screen"><link rel="stylesheet" href="../../../../print.css" type="text/css" media="print"><link rel="stylesheet" href="../../../../override.css" type="text/css"><meta name="keywords" content="Input,org.flixel.system.input.Input,addKey,any,destroy,destroy,getKeyCode,getScreenPosition,getWorldPosition,handleKeyDown,handleKeyUp,handleMouseDown,handleMouseUp,handleMouseWheel,hide,justPressed,justPressed,justReleased,justReleased,load,playback,playback,pressed,pressed,record,record,reset,reset,show,unload,update,update,updateCursor"><title>org.flixel.system.input.Input</title></head><body><script language="javascript" type="text/javascript" src="../../../../asdoc.js"></script><script language="javascript" type="text/javascript" src="../../../../help.js"></script><script language="javascript" type="text/javascript" src="../../../../cookies.js"></script><script language="javascript" type="text/javascript"><!--
asdocTitle = 'Input - API Documentation';
var baseRef = '../../../../';
window.onload = configPage;
--></script>
<script type="text/javascript">
scrollToNameAnchor();
</script><table class="titleTable" cellpadding="0" cellspacing="0" id="titleTable" style="display:none"><tr><td class="titleTableTitle" align="left">API Documentation</td><td class="titleTableTopNav" align="right"><a href="../../../../package-summary.html" onclick="loadClassListFrame('../../../../all-classes.html')">All Packages</a> | <a href="../../../../class-summary.html" onclick="loadClassListFrame('../../../../all-classes.html')">All Classes</a> | <a href="../../../../all-index-A.html" onclick="loadClassListFrame('../../../../index-list.html')">Index</a> | <a id="framesLink1" href="../../../../index.html?org/flixel/system/input/Input.html&org/flixel/system/input/class-list.html">Frames</a><a id="noFramesLink1" style="display:none" href="" onclick="parent.location=document.location"> No Frames </a></td><td class="titleTableLogo" align="right" rowspan="3"><img src="../../../../images/logo.jpg" class="logoImage" alt=" Adobe Logo " title=" Adobe Logo "></td></tr><tr class="titleTableRow2"><td class="titleTableSubTitle" id="subTitle" align="left">Input</td><td class="titleTableSubNav" id="subNav" align="right"><a href="#methodSummary">Methods</a></td></tr><tr class="titleTableRow3"><td colspan="3"> </td></tr></table><script language="javascript" type="text/javascript" xml:space="preserve">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Input"); titleBar_setSubNav(false,false,false,false,false,false,false,false,true,false,false ,false,false,false,false,false);}
-->
</script><div xmlns:fn="http://www.w3.org/2005/xpath-functions" class="MainContent"><table class="classHeaderTable" cellpadding="0" cellspacing="0"><tr><td class="classHeaderTableLabel">Package</td><td><a href="package-detail.html" onclick="javascript:loadClassListFrame('class-list.html')">org.flixel.system.input</a></td></tr><tr><td class="classHeaderTableLabel">Class</td><td class="classSignature">public class Input</td></tr><tr><td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">Input <img src="../../../../images/inherit-arrow.gif" title="Inheritance" alt="Inheritance" class="inheritArrow"> Object</td></tr><tr><td class="classHeaderTableLabel">Subclasses</td><td> <a href="../../../../org/flixel/system/input/Keyboard.html">Keyboard</a></td></tr></table><p></p><p></p><p></p>
Basic input class that manages the fast-access Booleans and detailed key-state tracking.
Keyboard extends this with actual specific key data.
<p></p><br/><hr></div><a name="methodSummary"></a><div class="summarySection"><div class="summaryTableTitle">Public Methods </div><table cellspacing="0" cellpadding="3" class="summaryTable " id="summaryTableMethod"><tr><th> </th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined By</th></tr><tr class=""><td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#Input()" class="signatureLink">Input</a>()</div><div class="summaryTableDescription">
Constructor
</div></td><td class="summaryTableOwnerCol">Input</td></tr><tr class=""><td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#any()" class="signatureLink">any</a>():Boolean</div><div class="summaryTableDescription">
Check to see if any keys are pressed right now.</div></td><td class="summaryTableOwnerCol">Input</td></tr><tr class=""><td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#destroy()" class="signatureLink">destroy</a>():void</div><div class="summaryTableDescription">
Clean up memory.</div></td><td class="summaryTableOwnerCol">Input</td></tr><tr class=""><td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#getKeyCode()" class="signatureLink">getKeyCode</a>(KeyName:String):int</div><div class="summaryTableDescription">
Look up the key code for any given string name of the key or button.</div></td><td class="summaryTableOwnerCol">Input</td></tr><tr class=""><td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#justPressed()" class="signatureLink">justPressed</a>(Key:String):Boolean</div><div class="summaryTableDescription">
Check to see if this key was just pressed.</div></td><td class="summaryTableOwnerCol">Input</td></tr><tr class=""><td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#justReleased()" class="signatureLink">justReleased</a>(Key:String):Boolean</div><div class="summaryTableDescription">
Check to see if this key is just released.</div></td><td class="summaryTableOwnerCol">Input</td></tr><tr class=""><td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#playback()" class="signatureLink">playback</a>(Record:Array):void</div><div class="summaryTableDescription">
Part of the keystroke recording system.</div></td><td class="summaryTableOwnerCol">Input</td></tr><tr class=""><td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#pressed()" class="signatureLink">pressed</a>(Key:String):Boolean</div><div class="summaryTableDescription">
Check to see if this key is pressed.</div></td><td class="summaryTableOwnerCol">Input</td></tr><tr class=""><td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#record()" class="signatureLink">record</a>():Array</div><div class="summaryTableDescription">
If any keys are not "released" (0),
this function will return an array indicating
which keys are pressed and what state they are in.</div></td><td class="summaryTableOwnerCol">Input</td></tr><tr class=""><td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#reset()" class="signatureLink">reset</a>():void</div><div class="summaryTableDescription">
Resets all the keys.</div></td><td class="summaryTableOwnerCol">Input</td></tr><tr class=""><td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#update()" class="signatureLink">update</a>():void</div><div class="summaryTableDescription">
Updates the key states (for tracking just pressed, just released, etc).</div></td><td class="summaryTableOwnerCol">Input</td></tr></table></div><a name="protectedMethodSummary"></a><div class="summarySection"><div class="summaryTableTitle">Protected Methods </div><table cellspacing="0" cellpadding="3" class="summaryTable " id="summaryTableProtectedMethod"><tr><th> </th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined By</th></tr><tr class=""><td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#addKey()" class="signatureLink">addKey</a>(KeyName:String, KeyCode:uint):void</div><div class="summaryTableDescription">
An internal helper function used to build the key array.</div></td><td class="summaryTableOwnerCol">Input</td></tr></table></div><script language="javascript" type="text/javascript"><!--
showHideInherited();
--></script><div class="MainContent"><a name="constructorDetail"></a><div class="detailSectionHeader">Constructor Detail</div><a name="Input()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">Input</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">Constructor</td></tr></table><div class="detailBody"><code>public function Input()</code><p></p><p>
Constructor
</p></div><a name="methodDetail"></a><div class="detailSectionHeader">Method Detail</div><a name="addKey()"></a><a name="addKey(String,uint)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">addKey</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td></tr></table><div class="detailBody"><code> protected function addKey(KeyName:String, KeyCode:uint):void</code><p></p><p></p><p>
An internal helper function used to build the key array.
</p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">KeyName</span>:String</code> — String name of the key (e.g. "LEFT" or "A")
</td></tr><tr><td class="paramSpacer"> </td></tr><tr><td width="20px"></td><td><code><span class="label">KeyCode</span>:uint</code> — The numeric Flash code for this key.
</td></tr></table></p></div><a name="any()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">any</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule"> </td></tr></table><div class="detailBody"><code> public function any():Boolean</code><p></p><p></p><p>
Check to see if any keys are pressed right now.
</p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code>Boolean</code> — Whether any keys are currently pressed.
</td></tr></table></div><a name="destroy()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">destroy</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule"> </td></tr></table><div class="detailBody"><code> public function destroy():void</code><p></p><p></p><p>
Clean up memory.
</p></div><a name="getKeyCode()"></a><a name="getKeyCode(String)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">getKeyCode</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule"> </td></tr></table><div class="detailBody"><code> public function getKeyCode(KeyName:String):int</code><p></p><p></p><p>
Look up the key code for any given string name of the key or button.
</p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">KeyName</span>:String</code> — The <code>String</code> name of the key.
</td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code>int</code> — The key code for that key.
</td></tr></table></div><a name="justPressed()"></a><a name="justPressed(String)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">justPressed</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule"> </td></tr></table><div class="detailBody"><code> public function justPressed(Key:String):Boolean</code><p></p><p></p><p>
Check to see if this key was just pressed.
</p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">Key</span>:String</code> — One of the key constants listed above (e.g. "LEFT" or "A").
</td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code>Boolean</code> — Whether the key was just pressed
</td></tr></table></div><a name="justReleased()"></a><a name="justReleased(String)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">justReleased</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule"> </td></tr></table><div class="detailBody"><code> public function justReleased(Key:String):Boolean</code><p></p><p></p><p>
Check to see if this key is just released.
</p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">Key</span>:String</code> — One of the key constants listed above (e.g. "LEFT" or "A").
</td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code>Boolean</code> — Whether the key is just released.
</td></tr></table></div><a name="playback()"></a><a name="playback(Array)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">playback</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule"> </td></tr></table><div class="detailBody"><code> public function playback(Record:Array):void</code><p></p><p></p><p>
Part of the keystroke recording system.
Takes data about key presses and sets it into array.
</p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">Record</span>:Array</code> — Array of data about key states.
</td></tr></table></p></div><a name="pressed()"></a><a name="pressed(String)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">pressed</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule"> </td></tr></table><div class="detailBody"><code> public function pressed(Key:String):Boolean</code><p></p><p></p><p>
Check to see if this key is pressed.
</p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">Key</span>:String</code> — One of the key constants listed above (e.g. "LEFT" or "A").
</td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code>Boolean</code> — Whether the key is pressed
</td></tr></table></div><a name="record()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">record</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule"> </td></tr></table><div class="detailBody"><code> public function record():Array</code><p></p><p></p><p>
If any keys are not "released" (0),
this function will return an array indicating
which keys are pressed and what state they are in.
</p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code>Array</code> — An array of key state data. Null if there is no data.
</td></tr></table></div><a name="reset()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">reset</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule"> </td></tr></table><div class="detailBody"><code> public function reset():void</code><p></p><p></p><p>
Resets all the keys.
</p></div><a name="update()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">update</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule"> </td></tr></table><div class="detailBody"><code> public function update():void</code><p></p><p></p><p>
Updates the key states (for tracking just pressed, just released, etc).
</p></div><br/><br/><hr><br/><p></p><center class="copyright"><footer></footer><br/>Thu Apr 28 2011, 06:17 PM -05:00 </center></div></body></html><!--<br/>Thu Apr 28 2011, 06:17 PM -05:00 -->