[Laszlo-dev] What was the reason for cancelling the events with keycode == 0 ?

Henry Minsky hminsky at laszlosystems.com
Wed Jun 3 08:43:33 PDT 2009


The last thing that is preventing text selection from working in IE7 is this
code in the MouseKernel.__mouseEvent which
which explicitly cancels a mouse event when it's keyCode == 0.

Now, I'm trying to understand why we need this code.

As I understand it, the LzKeyboardKernel.__cancelKeys flag is being set by
the LzInputTextSprite
when it wants to make sure that a text field does not respond to any mouse
or keyboard events (?).

In addition, the reason we're passing the mouse event at all to
KeyboardKernel is to inspect it's keyCode field for control keys that might
be down, but that we didn't get explicit keyboard events for.

So ... if I were to remove this block of code from
LzMouseKernel.__mouseEvent, what would
I be breaking?

It seems like if I removed this code, then in some cases input text fields
may respond to
mouse events when we don't want them to?



         // send option/shift/ctrl key events
         if (window['LzKeyboardKernel'] &&
LzKeyboardKernel['__updateControlKeys']) {
             LzKeyboardKernel.__updateControlKeys(e);
-
-            // FIXME: [20090602 anba] this prevents text selection, see
LPP-8200
-            if (LzKeyboardKernel.__cancelKeys && e.keyCode == 0) {
-                e.cancelBubble = true;
-                e.returnValue = false;
-            }




-- 
Henry Minsky
Software Architect
hminsky at laszlosystems.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-dev/attachments/20090603/a1f80997/attachment-0001.html


More information about the Laszlo-dev mailing list