OLPCities/Keyboard: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
To use this library (this Class) add |
To use this library (this Class) add one line to the <HEAD> section of the web page of the Lot. |
||
<pre> |
|||
⚫ | |||
<script language="Javascript" src="http://www.dmu.com/olpc/gamelib_keyboard.js"></script> |
|||
</pre> |
|||
⚫ | |||
[http://www.dmu.com/olpc/gamelib_keyboard.js gamelib_keyboard.js ] |
[http://www.dmu.com/olpc/gamelib_keyboard.js gamelib_keyboard.js ] |
||
Line 26: | Line 23: | ||
There are only one property for this object and it's used testing if it's true or not. Example: |
There are only one property for this object and it's used testing if it's true or not (inside a "timer loop"). Example: |
||
<pre> |
<pre> |
||
Line 33: | Line 30: | ||
} |
} |
||
</pre> |
</pre> |
||
[[Category:OLPCities_JavaScript_Libraries]] |
Latest revision as of 23:40, 13 February 2007
This library is part of the Gamelib, created by Scott Porter and updated by Brent Silby. Gamelib is available under the terms of the GNU Library General Public Licence.
To use this library (this Class) add one line to the <HEAD> section of the web page of the Lot.
You need to click this link and "save" the library at the same folder of the web page or put it at another folder at the same server and make a reference:
If you put it at the same folder, the line would be:
<script language="Javascript" src="gamelib_keyboard.js"></script>
To create an "object" of the Class you define the keyboard key. Examples:
upkey = Kb_trapkey("UP"); Gkey = Kb_trapkey("G");
The case is not considered.
There are only one property for this object and it's used testing if it's true or not (inside a "timer loop"). Example:
if(upKey.pressed){ // do something }