[Laszlo-checkins] r9441 - openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9

bargull@openlaszlo.org bargull at openlaszlo.org
Tue Jun 3 05:59:47 PDT 2008


Author: bargull
Date: 2008-06-03 05:59:44 -0700 (Tue, 03 Jun 2008)
New Revision: 9441

Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzKeyboardKernel.as
   openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzSprite.as
Log:
Change 20080602-bargull-PD6 by bargull at dell--p4--2-53 on 2008-06-02 23:51:29
    in /home/Admin/src/svn/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: last updates for weather-demo

New Features:

Bugs Fixed: LPP-6091

Technical Reviewer: hminsky
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:
Last updates to get weather working:
- disable "tabEnabled" for flash-sprites and flash-simplebuttons, so they won't interfere with our focus-system
- fix keyboard-kernel to send keyCode if charCode is 0, e.g. if you press an arrow-key 
- initialize values in "__downKeysHash", so we won't fire wrong key-events for these keys initially
    

Tests:
keyboard navigation works now in weather demo



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzKeyboardKernel.as
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzKeyboardKernel.as	2008-06-03 09:54:01 UTC (rev 9440)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzKeyboardKernel.as	2008-06-03 12:59:44 UTC (rev 9441)
@@ -11,12 +11,22 @@
 // Receives keyboard events from the runtime
 class LzKeyboardKernelClass
 {
-    var __downKeysHash = {};
+    private var __downKeysHash:Object = {'alt': false, 'control': false, 'shift': false};
+    private const __codes:Object = {16: 'shift', 17: 'control'};
 
     function __keyboardEvent ( e, t ){   
-        var k = e.charCode;
         var delta = {};
-        var s = String.fromCharCode(k).toLowerCase();
+        var s, k = e.charCode;
+        if (k != 0) {
+            s = String.fromCharCode(k).toLowerCase();
+        } else {
+            k = e.keyCode;
+            if (this.__codes[k]) {
+                s = this.__codes[k];
+            } else {
+                s = k;
+            }
+        }
         var dh = this.__downKeysHash;
         var dirty = false;
         if (t == 'onkeyup') {

Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzSprite.as
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzSprite.as	2008-06-03 09:54:01 UTC (rev 9440)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzSprite.as	2008-06-03 12:59:44 UTC (rev 9441)
@@ -314,6 +314,7 @@
           if (this.clickable == c) return;
           this.clickable = c;
           this.buttonMode = c;
+          this.tabEnabled = false;
           this.mouseEnabled = c;
           attachMouseEvents(this);
           var cb:SimpleButton = this.clickbutton;
@@ -326,6 +327,7 @@
                   addChild(cb);
               }
               cb.useHandCursor = true;
+              cb.tabEnabled = false;
               var cr = new Shape();
               this.clickregion = cr;
               cr.graphics.beginFill(0xffffff);



More information about the Laszlo-checkins mailing list