[Laszlo-dev] UPDATED For Review: Change 20090310-hqm-N Summary: Fix for missing key up events in swf runtime

André Bargull andre.bargull at udo.edu
Wed Mar 11 09:40:41 PDT 2009


I've changed LzKeys a bit (see attachment):
- marked ctrlKey as private so it won't show up in reference
- changed "gotKeyUp()" to make sure the extra-steps for Flash aren't 
compiled into the DHTML LFC
- update the "downKeysArray" before sending the onkeyup-event (as it was 
done before the change)
- clear "downKeysHash" before sending the batch onkeyups, that way 
"isKeyDown()" will report false if called on onkeyup-event

Otherwise approved!

On 3/10/2009 2:40 PM, Henry Minsky wrote:
> This seems to be returning no extra key up events now. I tested on OSX 
> and Windows XP/IE. I didn't test in Windows XP/Firefox though.
> 
> 
> 
> Change 20090310-hqm-N by hqm at badtzmaru.home on 2009-03-10 09:31:40 EDT
>     in /Users/hqm/openlaszlo/trunk7
>     for http://svn.openlaszlo.org/openlaszlo/trunk
> 
> Summary: workaround for missing Flash keyboard events
> 
> Summary:  Fix for missing key up events in swf runtime
> 
> New Features:
> 
> Bugs Fixed: LPP-7012
> 
> Technical Reviewer: andre
> QA Reviewer: promanik
> Doc Reviewer: (pending)
> 
> Documentation:
> 
> Release Notes:
> 
> Details:
> 
> + This works around the bug with the LFC tracking whether the command key
> is down, which shows up in the debugger where keyboard commands like
> 'enter' no longer respond.
> 
> It does have the effect of making the model of the down keys slightly
> wrong; if the user presses 'v', then 'command', and then releases the
> 'command' key, the 'v' key will be regarded as having gone up also.
> 
> + Added a "ctrlKey" flag which is passed from the SWF8 and SWF9 kernel
> up to the LFC LzKeysService object.  For a key up event, this flag
> says whether Flash thinks the control key was down when a key is
> pressed or released.
> 
> This is used to by lzKeys.gotKeyUp to try to correct the state of the
> downKeys table. The workaround is to err on the side of believing that
> the control key is up.
> 
> 
> + Also a cleanup of swf8 keyboard and mouse event dispatch -- removed the
> obscure setup of keyboard and mouse handler from SWFFile.java, and
> replaced with more conventional modern listeners in LzKeyboardKernel
> and LzMouseKernel
> 
> 
> Tests:
> 
> + in app running in Flash (8 or 9), type command key sequence
> 
> [ctrl down] [v down] [ctrl up] [v up]
> 
> See if Debugger still responds to "Enter" command to evaluate an expression
> 
> 
> + in app running in Flash (8 or 9), type command key sequence
> 
> [ctrl down] [v down] [v up] [ctrl up]
> 
> See if Debugger still responds to "Enter" command to evaluate an expression
> 
> + test case
>     <canvas debug="true" >
>      <handler name="onkeydown" args="kc" reference="lz.Keys" >
>        Debug.write("onkeydown for %s", kc);
>      </handler>
>      <handler name="onkeyup" args="kc" reference="lz.Keys" >
>        Debug.write("onkeyup for %s", kc);
>      </handler>
>     </canvas>
> 
> Firefox3+SWF9: Press ctrl, press v, release v, release ctrl:
> 
> onkeydown for 17
> onkeydown for 86
> onkeyup for 86
> onkeyup for 17
> 
> 
> Firefox3+SWF9: Press Command, press v, release v, release Command:
> onkeydown for 17
> onkeydown for 86
> onkeyup for 17
> onkeyup for 86
> 
> 
> Firefox3+SWF8/9,DHTML: Press v, press ctrl, release ctrl, release v
> ---
> onkeydown for 86
> onkeydown for 17
> onkeyup for 17
> onkeyup for 86
> 
> Files:
> M      test/hello.lzx
> M      WEB-INF/lps/lfc/kernel/swf/LzMouseKernel.as
> M      WEB-INF/lps/lfc/kernel/swf/LzKeyboardKernel.as
> M      WEB-INF/lps/lfc/kernel/swf9/LzKeyboardKernel.as
> M      WEB-INF/lps/lfc/services/LzKeys.lzs
> M      WEB-INF/lps/server/src/org/openlaszlo/compiler/SWFFile.java
> 
> Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20090310-hqm-N.tar
> 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: LzKeys2.lzs
Url: http://www.openlaszlo.org/pipermail/laszlo-dev/attachments/20090311/b25e8d81/LzKeys2.pl


More information about the Laszlo-dev mailing list