how to send key event

Login to reply to this topic.
Fri, 2005-03-04 08:08
Joined: 2004-12-03
Forum posts: 28
hi,

  i want to send key event from my application for phone application & for calculator,
when i go to phone application, it is displaying phone screen with keys on screen. for this application i want to send key event without screen tap. how should i send this event.

thanks in advance............
santosh............

PLZ HElP ME.....


Tue, 2005-06-07 09:12
Joined: 2005-05-09
Forum posts: 33
Re: how to send key event

Santhosh i  am newbie  i too searching for the same kind of stuff.., if u got any idea please reply to this.

i am research scholor in IIT Madras, working on distributed speech recognition in symbain based based phones.


here is some related information i found in one thread here in newLC it might be useful to you

I have written a class to post some keyEvents, it has a public method to do it,

now I want to post a string of keys,  i.e.  01234567891, the length of this string is 11,
the first ten of digist are posted successfully but the last digit can't be posted without any error,...
I just see 0123456789 on screen, the last digit (1) can't be posted,

Why? is there any buffer?

here is my public method of KeyPoster ActiveObject :

++++++++++++++++++++
void CKeyEventPoster::StartPostingKeyEvents(TUint aCode, TInt aModifier, TInt aRepeat, TInt aScanCode )
{

   TWsEvent event;
   TInt iForegroundWinGroup = iWsSession.GetFocusWindowGroup();

        event.SetType(EEventKeyDown);
        event.SetTimeNow();
        event.Key()->iCode = aCode;
        event.Key()->iModifiers = aModifier;
        event.Key()->iRepeats = aRepeat;
        event.Key()->iScanCode = aScanCode;
        iWsSession.SendEventToWindowGroup(iForegroundWinGroup, event);

        event.SetType(EEventKey);
        event.SetTimeNow();
        event.Key()->iCode = aCode;
        event.Key()->iModifiers = aModifier;
        event.Key()->iRepeats = aRepeat;
        event.Key()->iScanCode = aScanCode;
        iWsSession.SendEventToWindowGroup(iForegroundWinGroup, event);

        event.SetType(EEventKeyUp);
        event.SetTimeNow();
        event.Key()->iCode = aCode;
        event.Key()->iModifiers = aModifier;
        event.Key()->iRepeats = aRepeat;
        event.Key()->iScanCode = aScanCode;
        iWsSession.SendEventToWindowGroup(iForegroundWinGroup, event);
}
+++++++++++++++

and I call it in this way:

               iKeyEventPoster -> StartPostingKeyEvents('0' ,0, 0, EStdKeyNull);
               iKeyEventPoster -> StartPostingKeyEvents('1' ,0, 0, EStdKeyNull);
               iKeyEventPoster -> StartPostingKeyEvents('2' ,0, 0, EStdKeyNull);
               iKeyEventPoster -> StartPostingKeyEvents('3' ,0, 0, EStdKeyNull);
               iKeyEventPoster -> StartPostingKeyEvents('4' ,0, 0, EStdKeyNull);
               iKeyEventPoster -> StartPostingKeyEvents('5' ,0, 0, EStdKeyNull);
               iKeyEventPoster -> StartPostingKeyEvents('6' ,0, 0, EStdKeyNull);
               iKeyEventPoster -> StartPostingKeyEvents('7' ,0, 0, EStdKeyNull);
               iKeyEventPoster -> StartPostingKeyEvents('8' ,0, 0, EStdKeyNull);
               iKeyEventPoster -> StartPostingKeyEvents('9' ,0, 0,
EStdKeyNull);
              iKeyEventPoster -> StartPostingKeyEvents('1' ,0, 0,
EStdKeyNull);
++++++++++++++++++++
the red line doesn't work,...
Why?
 
 -----------------------------
 
  • Login to reply to this topic.