Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Posts: 157
Registered: ‎12-16-2010
My Device: Torch 9800, PlayBook
My Carrier: I carry it myself

Capturing keyboard events (key press) anywhere in application

I've read number of threads here about capturing keyboard events and cannot find conclusive answer...


I need to capture keyboard events in the application without using any TextInput or other text entry controls. I tried adding below but nothing works....?


stage.addEventListener(KeyboardEvent.KEY_DOWN, key_pressed);


QNXApplication.qnxApplication.addEventListener(KeyboardEvent.KEY_DOWN, keyDown);


this.addEventListener(KeyboardEvent.KEY_DOWN, keyDown);
If you find this post helpful please "like" it and accept as a solution.
Posts: 508
Registered: ‎01-19-2011
My Device: My Trusty Red Plane
My Carrier: Outer Space

Re: Capturing keyboard events (key press) anywhere in application

(if this question is related to ->on the simulator<--, not on the actual playbook)


adding the listener to the stage should work. try this



					trace("key pressed " + e.keyCode);

 that part worked for me. maybe you tried to catch the wrong letter?


I'm a bird from outer space. But I'm not flappy o.o