Approved!

(tested in FF2, IE6, IE7, Opera9, Safari (Win))

Note:
"Alt Gr" still sends two keydown and one (!) resp. two keyup events, but this is not our fault, there are really 2x2 events send by the browser. Firefox is in this case quite annoying, pressing "Alt Gr" generates two keydown-events (17 and 18, so ctrl (17) and alt (18)), but only one keyup-event (for 17 (ctrl)), and unfortunately this will break the downkeys-hash in the keyboard-kernel. Do we need to document this behaviour somewhere? I guess we should do so.

On 2/14/2008 2:38 AM, Max Carlson wrote:
Change 20080213-maxcarlson-4 by [EMAIL PROTECTED] on 2008-02-13 17:34:25 PST
    in /Users/maxcarlson/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Avoid sending duplicate shift, ctrl, option events in inputtext

New Features:

Bugs Fixed: LPP-4267 - Onkeyup and onkeydown events fire twice in edittext and inputtext

Technical Reviewer: promanik
QA Reviewer: [EMAIL PROTECTED]
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details: Avoid sending shift, ctrl and option keys by preventing the keyboard state from getting dirtied.


Tests: This runs consistently in swf and dhtml (FF osx and IE 6)
<canvas height="300">
<simplelayout/>
 <edittext id="ex" width="100">
 <handler name="onkeydown" args="kc">
 Debug.warn('keydown %w', kc);
 </handler>
 <handler name="onkeyup" args="kc">
 Debug.warn('keyup %w', kc);
 </handler>
 </edittext>

 <inputtext id="ix" width="100">
 <handler name="onkeydown" args="kc">
 Debug.warn('keydown %w', kc);
 </handler>
 <handler name="onkeyup" args="kc">
 Debug.warn('keyup %w', kc);
 </handler>
 </inputtext>

 <button>foo</button>

 <handler name="onkeydown" reference="LzKeys" args="kc">
 Debug.warn('global keydown %w', kc);
 </handler>

 <handler name="onkeyup" reference="LzKeys" args="kc">
 Debug.warn('global keyup %w', kc);
 </handler>
 </canvas>


Files:
M      WEB-INF/lps/lfc/kernel/dhtml/LzKeyboardKernel.js

Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20080213-maxcarlson-4.tar

--

Reply via email to