RE: [Flashcoders] How to detect for modifier (alt/ctrl) keys

2010-11-20 Thread Benny
just Alt -Oorspronkelijk bericht- Van: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] Namens Henrik Andersson Verzonden: dinsdag 16 november 2010 14:54 Aan: Flash Coders List Onderwerp: Re: [Flashcoders] How to detect for modifier (alt/ctrl

RE: [Flashcoders] How to detect for modifier (alt/ctrl) keys

2010-11-20 Thread Benny
...@chattyfig.figleaf.com] Namens Glen Pike Verzonden: dinsdag 16 november 2010 1:08 Aan: Flash Coders List Onderwerp: Re: [Flashcoders] How to detect for modifier (alt/ctrl) keys Yes, but if you don't use keyEvent.ctrlKey in your event handler, but check for CTRL and set a flag: e.g. public static const

Re: [Flashcoders] How to detect for modifier (alt/ctrl) keys

2010-11-19 Thread Henrik Andersson
I am curious, does the key say Alt or AltGr? They are not quite the same. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

RE: [Flashcoders] How to detect for modifier (alt/ctrl) keys

2010-11-19 Thread Benny
The work-around I listed would of course only work if you are just interested in key combo's with either Alt or Ctrl. Something like (right) Alt-Ctrl-5 won't work. I had a second thought on Henriks comment about Alt vs AltGr and Googled a bit. Part of Wiki article: Control + Alt

[Flashcoders] How to detect for modifier (alt/ctrl) keys

2010-11-15 Thread Benny
In an application I am building I need to detect whether the (right) alt-key was pressed in combination with another (letter) and make sure that the control key isn't being pressed at the same time. But it looks like the Keyboard events for both MOUSE_DOWN and MOUSE_UP always return true for

Re: [Flashcoders] How to detect for modifier (alt/ctrl) keys

2010-11-15 Thread Glen Pike
Hi, I would suggest using a keyboard manager class that tracks when various keys are pressed and sets a flag - this would effectively allow you to Poll such keys when you are checking others. There is a good example from Richard Lord here:

RE: [Flashcoders] How to detect for modifier (alt/ctrl) keys

2010-11-15 Thread Benny
Thanks for the tip Glen. Unfortunately that class also shows the problem of Keyboard.CONTROL (keycode 17) being reported as being down (while it actual isn't) when the right alt key is being pressed. - Benny ___ Flashcoders mailing list

Re: [Flashcoders] How to detect for modifier (alt/ctrl) keys

2010-11-15 Thread Anthony Pace
Just thinking out loud, but I took a look at the code and I am wondering if this would this not be better implemented as a singleton? On 11/15/2010 6:01 PM, Glen Pike wrote: Hi, I would suggest using a keyboard manager class that tracks when various keys are pressed and sets a flag - this

Re: [Flashcoders] How to detect for modifier (alt/ctrl) keys

2010-11-15 Thread Glen Pike
Yes, but if you don't use keyEvent.ctrlKey in your event handler, but check for CTRL and set a flag: e.g. public static const CTRL_KEYCODE:int = 17; private var _ctrlKeyDown:Boolean = false; //etc function onKeyDownHandler(e:KeyboardEvent):void { switch(e.keyCode) {