PDA

View Full Version : callOnKeyCombo


epopov
11-17-2003, 07:48 AM
Hi,
I want to instruct the lzKeys service to call the delegate 'delCtrlZ' whenever the 'Ctrl+Z' key combination is pressed.
I try to do this using next code:

delCtrlZ = new LzDelegate(this, "pressCtrlZ" );
LzKeys.callOnKeyCombo(this.delCtrlZ, ["control","z"]);

But lzKeys service calls my delegate only once (on first 'Ctrl+Z' combination).

How to solve this problem?

antun
11-17-2003, 07:52 AM
It's working for me. Here's what I did:


<canvas debug="true">
<script>
canvas.delCtrlZ = new LzDelegate(canvas, "pressCtrlZ" );

LzKeys.callOnKeyCombo(canvas.delCtrlZ, ["control","z"]);
</script>

<method name="pressCtrlZ">
debug.write( 'pressCtrlZ called' );
</method>

</canvas>


Could you run the above and let me know if that works?

-Antun