|
|||
|
Is it possible to create a Key Listener in SWFKit? I'd like to configure SWFKit so that it doesn't send Key Presses to Flash (I know how to do that) and I have SWFKit listen for certain Keys and call code within my Flash application. I have an old Flash application written by someone else. Their key handlers don't work properly, and I thought this would be the quickest fix.
Thanks! |
|
|||
|
Code:
var wnd = FlashPlayer.window;
wnd.onMessage = function (message, wparam, lparam)
{
/*
* Capture the WM_CHAR message, which is sent to the flash movie
* when a key is pressed, for a WM_CHAR message, the wparam parameter is the char code
*/
if (message == /*WM_CHAR*/0x102)
{
if (wparam == '9'.charCodeAt(0))
{
trace("captured!");
/*
* The key press '9' is captured. Now you can do somthing to
* handle this event.
*/
// ...
}
}
}
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|