Hello all. I've been working with a couple of developers over on the
FlashNewbie list on this without success. I'm hoping that with the
larger Flash developer audience on this list someone may have an answer.

I'm trying to assign keypress combinations to buttons such as Control+a,
Control+b, and so on. Problem is that I cannot find any code that
captures the Control+a or Control+c key combos. The theory is that
Windows XP is intercepting the keys since those key combos are used by
the Windows OS for selecting and copying. I've tried several variations
of code but all fail on Control+a and Control+c. Here is my latest
attempt (mind the wrap):

createTextField("message_txt", 100, 0, 0, 550, 400);

var ctrlPressed:Boolean = false;
var ctrlKeyListener:Object = new Object();
var letterKeyListener:Object = new Object();

ctrlKeyListener.onKeyDown = function() {
        if (Key.getCode() == 17) {
                ctrlPressed = true;
                message_txt.text = "CTRL down";
        }
};

letterKeyListener.onKeyDown = function() {
        if (ctrlPressed == true && Key.getCode() == 65) {
                message_txt.text = "CTRL+A down";
        }
};

Key.addListener(ctrlKeyListener);
Key.addListener(letterKeyListener);

If I change the key code to B (66) rather than A (65) this code works
great.

Is there a simple way to make this work or will Control+a and Control+c
fail under all circumstances?

Thanks.

Dave
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to