Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-16-2006, 01:59 PM
Junior Member
 
Join Date: Jan 2003
Posts: 12
Default Key Listener in SWFKit

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!
Reply With Quote
  #2 (permalink)  
Old 03-16-2006, 04:58 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Key Listener in SWFKit

We're not sure whether the onMsg event can work. We will try it and get back to you.
Reply With Quote
  #3 (permalink)  
Old 03-21-2006, 01:15 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Key Listener in SWFKit

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. 
          */
         
         // ...
      }
   }
}
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 03:37 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.