0

I am working on one enterprise app. In that, I need to open one popup on one shortcut key, which is the combination of Alt+AnyCharKey.

So when I press that key with Alt, for different char keys, different numbers or characters is typed in TextInput.

Suppose If I press Alt+A, it prints 1 in TextInput. So problem is, when I capture the shortcut key and opens a popup and by setting focus on TextInput of that popup, that number is typed in TextInput.

So how can I disable that Alt+Key combination in TextInput ???

Sam DeHaan
  • 10,246
  • 2
  • 40
  • 48
Mitul Golakiya
  • 402
  • 4
  • 20
  • Is this going to be an AIR app? If not, Alt+___ shortcuts will often activate browser shortcuts before flash gets ahold of them, you may run into an issue there. – Sam DeHaan Apr 19 '12 at 18:18

1 Answers1

0

Simple preventDefault on keyDown should help, I think

protected function textinput_keyDownHandler(event:KeyboardEvent):void
{
    if (event.altKey)
        event.preventDefault();
}
Art
  • 831
  • 3
  • 8
  • 26