[Laszlo-checkins] r14047 - openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml

bargull@openlaszlo.org bargull at openlaszlo.org
Tue Jun 2 13:51:31 PDT 2009


Author: bargull
Date: 2009-06-02 13:51:27 -0700 (Tue, 02 Jun 2009)
New Revision: 14047

Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzKeyboardKernel.js
Log:
Change 20090602-bargull-fI3 by bargull at dell--p4--2-53 on 2009-06-02 21:58:33
    in /home/Admin/src/svn/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: move stuck-key detection to updateControlKeys()

New Features:

Bugs Fixed: LPP-8218 - DHTML: issues with contextmenu onmenuopen, dragging (partial)

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

Documentation:

Release Notes:

Details:
Moved stuck-key detection from keyboardEvent() to updateControlKeys().
    

Tests:



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzKeyboardKernel.js
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzKeyboardKernel.js	2009-06-02 19:55:44 UTC (rev 14046)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzKeyboardKernel.js	2009-06-02 20:51:27 UTC (rev 14047)
@@ -45,39 +45,10 @@
             dirty = true;
         }
 
-        var stuck;
-        var meta = e['metaKey'];
-        if (LzSprite.prototype.quirks['detectstuckkeys']) {
-            // see LPP-8210
-            if (dh['meta'] != meta) {
-                // look for stuck keys
-                delta['control'] = meta;
-                dirty = true;
-                if (! meta) {
-                    for (var key in dh) {
-                        if (key == 'control' || key == 'shift' || key == 'alt' || key == 'meta') continue;
-                        stuck = key;
-                        delete dh[key];
-                    }
-                }
-            }
-        }
-        dh['meta'] = meta;
-
         if (dirty) {
             var scope = LzKeyboardKernel.__scope;
             var callback = LzKeyboardKernel.__callback;
             if (scope && scope[callback]) {
-                //console.log(t, s, k, delta, e.metaKey, e.ctrlKey, dh);
-                if (stuck) {
-                    // console.log('stuck key', key, keycode);
-                    var keycode = LzKeyboardKernel.__keyCodes[stuck];
-                    var fakedelta = {};
-                    // FIXME: [20090602 anba] 'key' seems to be a typo, should it be 'stuck'?
-                    fakedelta[key] = false;
-                    scope[callback](fakedelta, keycode, 'onkeyup');
-                }
-
                 scope[callback](delta, k, 'on' + t);
             }
         }
@@ -100,6 +71,7 @@
         //Debug.write('downKeysHash', t, k, dh, delta);
     }
     ,__updateControlKeys: function (e, delta) {
+        var quirks = LzSprite.prototype.quirks;
         var dh = LzKeyboardKernel.__downKeysHash;
         var dirty = false;
         if (delta) {
@@ -113,7 +85,7 @@
         if (dh['alt'] != alt) {
             delta['alt'] = alt;
             dirty = true;
-            if (LzSprite.prototype.quirks['alt_key_sends_control']) {
+            if (quirks['alt_key_sends_control']) {
                 delta['control'] = delta['alt'];
             }
         }
@@ -127,16 +99,46 @@
             delta['shift'] = shift;
             dirty = true;
         }
+        var stuck;
+        var meta = e['metaKey'];
+        if (quirks['detectstuckkeys']) {
+            // see LPP-8210
+            if (dh['meta'] != meta) {
+                // look for stuck keys
+                delta['control'] = meta;
+                dirty = true;
+                if (! meta) {
+                    for (var key in dh) {
+                        if (key == 'control' || key == 'shift' || key == 'alt' || key == 'meta') continue;
+                        stuck = key;
+                        delete dh[key];
+                    }
+                }
+            }
+        }
 
         dh['alt'] = alt;
         dh['control'] = ctrl;
         dh['shift'] = shift;
+        dh['meta'] = meta;
 
-        if (send && dirty) {
+        if (dirty && (send || stuck)) {
             var scope = LzKeyboardKernel.__scope;
             var callback = LzKeyboardKernel.__callback;
             if (scope && scope[callback]) {
-                scope[callback](delta, 0, 'on' + e.type);
+                //console.log(t, s, k, delta, e.metaKey, e.ctrlKey, dh);
+                if (stuck) {
+                    // console.log('stuck key', key, keycode);
+                    var keycode = LzKeyboardKernel.__keyCodes[stuck];
+                    var fakedelta = {};
+                    // FIXME: [20090602 anba] 'key' seems to be a typo, should it be 'stuck'?
+                    fakedelta[key] = false;
+                    scope[callback](fakedelta, keycode, 'onkeyup');
+                }
+
+                if (send) {
+                    scope[callback](delta, 0, 'on' + e.type);
+                }
             }
         }
 



More information about the Laszlo-checkins mailing list