[Laszlo-checkins] r8969 - in openlaszlo/trunk/WEB-INF/lps/lfc/services: . platform/dhtml platform/swf
max@openlaszlo.org
max at openlaszlo.org
Thu May 1 18:42:02 PDT 2008
Author: max
Date: 2008-05-01 18:41:57 -0700 (Thu, 01 May 2008)
New Revision: 8969
Removed:
openlaszlo/trunk/WEB-INF/lps/lfc/services/platform/dhtml/LzKeys.js
openlaszlo/trunk/WEB-INF/lps/lfc/services/platform/swf/LzKeys.as
Modified:
openlaszlo/trunk/WEB-INF/lps/lfc/services/LzKeys.lzs
Log:
Change 20080501-maxcarlson-o by maxcarlson at Roboto on 2008-05-01 14:49:14 PDT
in /Users/maxcarlson/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Fix documentation for LzKeys
New Features:
Bugs Fixed: LPP-5526 - LzKeys (dhtml) reference page problems
Technical Reviewer: promanik
QA Reviewer: hminsky
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: Remove unused files.
LzKeys.lzs - Update docs. Remove 'static' from events and use dynamic lookups when sending to prevent compilation errors in swf9.
Tests: 'cd docs/src;ant reference' and docs/reference/LzKeys.html should look good. test/lfc/legals/keyboardandmouse.lzx passes in swf8, dhtml and swf9.
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/services/LzKeys.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/services/LzKeys.lzs 2008-05-01 22:33:10 UTC (rev 8968)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/services/LzKeys.lzs 2008-05-02 01:41:57 UTC (rev 8969)
@@ -34,32 +34,50 @@
*
* @shortdesc Keyboard input service.
*/
-dynamic public class LzKeys {
+public class LzKeys {
/**
* A hash where each of the keys that is currently
* down on the keyboard is set to true.
* @type Object
+ * @access private
*/
static var downKeysHash = {};
/**
* An array of currently pressed key codes.
- * @type [Number]
+ * @type Array
+ * @access private
*/
static var downKeysArray = [];
+
+ /**
+ * An object used by callOnKeyCombo() to track kep combinations
+ * @type Object
+ * @access private
+ */
static var keycombos = {};
/**
- * event sent when a key is pressed; sent with keycode
+ * Sent when a key is pressed; sent with keycode
* for key that was pressed.
+ * @lzxtype event
+ * @access public
*/
- static var onkeydown = LzDeclaredEvent;
+ var onkeydown = LzDeclaredEvent;
/**
- * event sent whenever a key goes up; sent with keycode
+ * Sent whenever a key goes up; sent with keycode
* for key that was let go.
+ * @lzxtype event
+ * @access public
*/
- static var onkeyup = LzDeclaredEvent;
- static var onmousewheeldelta = LzDeclaredEvent;
+ var onkeyup = LzDeclaredEvent;
+ /**
+ * Sent when the mouse wheel changes state. Sent with a positive or
+ * negative number depending on the direction and amount the wheel moved.
+ * @lzxtype event
+ * @access public
+ */
+ var onmousewheeldelta = LzDeclaredEvent;
/** @access private */
@@ -83,7 +101,7 @@
*
* @access private
* @param Number kC: The Flash keycode for the key that is down.
- * @param string info: if "extra" then ignore if you already got one
+ * @param String info: if "extra" then ignore if you already got one
*/
static function gotKeyDown ( kC, info = null ){
if ( LzKeys.downKeysArray.length > 0 ){
@@ -107,7 +125,7 @@
// check for IME
if (LzKeys.downKeysHash[229] != true) {
- if (LzKeys.onkeydown.ready) LzKeys.onkeydown.sendEvent( kC );
+ if (LzKeys['onkeydown'].ready) LzKeys['onkeydown'].sendEvent( kC );
}
}
@@ -156,14 +174,14 @@
for ( var k in LzKeys.downKeysHash ){
LzKeys.downKeysArray.push( k );
}
- if (LzKeys.onkeyup.ready) LzKeys.onkeyup.sendEvent( kC );
+ if (LzKeys['onkeyup'].ready) LzKeys['onkeyup'].sendEvent( kC );
}
/**
- * @return Boolean: indicating whether the given key is down.
- * @param String k: The name of the key to check for downness or an array of
- * key names (e.g. ['shift', 'tab']
+ * @return Boolean: indicating whether the given key(s) are down.
+ * @param k: The name of the key to check for downness or an array of
+ * key names, e.g. ['shift', 'tab']
*/
static function isKeyDown ( k ){
if (typeof(k) == "string") {
@@ -274,7 +292,7 @@
* <li>' </li>
* </ul>
* @param LzDelegate d: The delegate to be called when the keycombo is down.
- * @param [String] kCArr: Array of strings indicating which keys constitute the
+ * @param Array kCArr: Array of strings indicating which keys constitute the
* keycombo. This array may be in any order.
*/
static function callOnKeyCombo ( d , kCArr ){
@@ -302,7 +320,7 @@
* Removes the request to call the delegate on the keycombo.
* @param LzDelegate d: The delegate that was to be called when the
* keycombo was down.
- * @param [String] kCArr: An array of strings indicating which keys
+ * @param Array kCArr: An array of strings indicating which keys
* constituted the keycombo.
*/
static function removeKeyComboCall ( d , kCArr ){
@@ -339,8 +357,12 @@
}
/**
- * @field Number mousewheeldelta: the amount the mouse wheel last moved. Use
- * onmousewheeldelta to learn when this value changes.
+ * The amount the mouse wheel last moved. Use the
+ * onmousewheeldelta event to learn when this value changes.
+ * @type Number
+ * @lzxtype Number
+ * @default 0
+ * @keywords readonly
*/
static var mousewheeldelta = 0;
@@ -348,12 +370,13 @@
static function __mousewheelEvent(d) {
//Debug.write('__mousewheelEvent', d);
LzKeys.mousewheeldelta = d;
- if (LzKeys.onmousewheeldelta.ready) LzKeys.onmousewheeldelta.sendEvent(d);
+ if (LzKeys['onmousewheeldelta'].ready) LzKeys['onmousewheeldelta'].sendEvent(d);
}
/**
* A hash that maps key names to key codes.
* @type Object
+ * @access private
*/
static var keyCodes = {
a : 65 ,
Deleted: openlaszlo/trunk/WEB-INF/lps/lfc/services/platform/dhtml/LzKeys.js
Deleted: openlaszlo/trunk/WEB-INF/lps/lfc/services/platform/swf/LzKeys.as
More information about the Laszlo-checkins
mailing list