PDA

View Full Version : LzKeys


ch_bowen
09-16-2003, 12:45 PM
I want to delegate to a method every time a user uses '<control>' / '<rightarrow>'. I have set up this using an LzDelegate as:
method event="oninit">
del = new LzDelegate(this.colWrapper.columns, "moveColumn" );
LzKeys.callOnKeyCombo(del, ["control", "leftarrow"]);
LzKeys.callOnKeyCombo(del, ["control","rightarrow"]);
LzKeys.callOnKeyCombo(del, ["control", "uparrow"]);
LzKeys.callOnKeyCombo(del, ["control", "downarrow"]);
</method>
However, method moveColumn() only gets called once. If I use the <control>/<shift> keys again, moveColumn() does not get called. Is this a bug?

Thanks

antun
09-17-2003, 09:16 AM
This works for me. I tried it in both 5 and 6 Flash Players. Are you still getting this?

Here's what I tried:


<canvas debug="true">
<method event="oninit">
del = new LzDelegate(this, "moveColumn" );
LzKeys.callOnKeyCombo(del, ["control", "leftarrow"]);
LzKeys.callOnKeyCombo(del, ["control","rightarrow"]);
LzKeys.callOnKeyCombo(del, ["control", "uparrow"]);
LzKeys.callOnKeyCombo(del, ["control", "downarrow"]);
</method>
<method name="moveColumn">
debug.write( 'moveColumn called' );
</method>
</canvas>


-Antun

ch_bowen
09-18-2003, 03:57 PM
Hi Antun,

For some reason, its still not working. I will look into it later on when I get a chance. Its when I add the <control> key with one of the arrows that I have problems. Just delegating on a key press of the arrows alone works fine.

benjamin
09-22-2005, 07:21 PM
I just ran across this, and it just needed one little tweak to get it up to working in lps 3.1 (dev).

<canvas debug="true">
<method event="oninit">
del = new LzDelegate(this, "moveColumn" );
LzKeys.callOnKeyCombo(del, ["control", "leftarrow"]);
LzKeys.callOnKeyCombo(del, ["control","rightarrow"]);
LzKeys.callOnKeyCombo(del, ["control", "uparrow"]);
LzKeys.callOnKeyCombo(del, ["control", "downarrow"]);
</method>
<method name="moveColumn">
Debug.write( 'moveColumn called' );
</method>
</canvas>


On the mac, "control" means the apple key. This is working for me in Safari, Tiger, FP8.