×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Oct 2004
    Posts
    25

    why I can't send the key "1" event

    RWsSession sess=CCoeEnv::Static()->WsSession();
    TWsEvent event;
    TInt id=sess.FindWindowGroupIdentifier( 0, _L("*Phone?") );


    event.SetType(EEventKey);
    event.SetTimeNow();
    event.Key()->iCode = 50;
    event.Key()->iModifiers = 1;
    event.Key()->iRepeats = 0;
    event.Key()->iScanCode = 50;
    sess.SendEventToWindowGroup( id, event );


    these are the code I want to send the keyevent "1" to phone frame,but there is no use to do it.

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,142

    Re: why I can't send the key "1" event

    have you tried searching this forum already, for example using keyword "sendkey" will give you quite many discussion threads on this topic.

    Also, you should define the target platform in your queries, for example in 3rd edition this function would need SwEvent capability, and without it it wouldn't do nothing really.

    yucca

  3. #3
    Registered User
    Join Date
    Feb 2007
    Location
    India
    Posts
    1,128

    Re: why I can't send the key "1" event

    Quote Originally Posted by songlinhe
    RWsSession sess=CCoeEnv::Static()->WsSession();
    TWsEvent event;
    TInt id=sess.FindWindowGroupIdentifier( 0, _L("*Phone?") );


    event.SetType(EEventKey);
    event.SetTimeNow();
    event.Key()->iCode = 50;
    event.Key()->iModifiers = 1;
    event.Key()->iRepeats = 0;
    event.Key()->iScanCode = 50;
    sess.SendEventToWindowGroup( id, event );


    these are the code I want to send the keyevent "1" to phone frame,but there is no use to do it.
    Hi songlinhe,

    I've seen your problem, You can use this code for sinding key '1'.

    TRawEvent ev1;
    TRawEvent ev2;
    RWsSession ws;
    ws.Connect();
    ev1.Set(TRawEvent::EKeyDown, 0x31);
    UserSvr::AddEvent(ev1);
    ev2.Set(TRawEvent::EKeyUp, 0x31);
    UserSvr::AddEvent(ev2);
    ws.Close();

    Hope It'll help you..!
    Keep going..!

  4. #4
    Registered User
    Join Date
    Oct 2004
    Posts
    25

    Re: why I can't send the key "1" event

    I'm sorry that there is no more details.The whole question is that ,if I want to call divert, one way I find is to send the code like"**21*number#", but when I simulate the press key event to phone frame, there is no reaction in phone frame.which puzzle me is if I have press any number key and the input dialog appeared , I send the Press key evnet to phone frame as follows, the number key took effect and there is the dialing event in the phone frame.


    RWsSession sess=CCoeEnv::Static()->WsSession();
    TWsEvent event;
    TInt id=sess.FindWindowGroupIdentifier( 0, _L("*Phone?") );



    event.SetType(EEventKey);
    event.SetTimeNow();
    event.Key()->iCode = 42;
    event.Key()->iModifiers = 1;
    event.Key()->iRepeats = 1;
    event.Key()->iScanCode = 42;
    sess.SendEventToWindowGroup( id, event );

    event.SetType(EEventKey);
    event.SetTimeNow();
    event.Key()->iCode = 42;
    event.Key()->iModifiers = 1;
    event.Key()->iRepeats = 0;
    event.Key()->iScanCode = 42;
    sess.SendEventToWindowGroup( id, event );

    event.SetType(EEventKey);
    event.SetTimeNow();
    event.Key()->iCode = 50;
    event.Key()->iModifiers = 1;
    event.Key()->iRepeats = 0;
    event.Key()->iScanCode = 50;
    sess.SendEventToWindowGroup( id, event );

    event.SetType(EEventKey);
    event.SetTimeNow();
    event.Key()->iCode = 49;
    event.Key()->iModifiers = 1;
    event.Key()->iRepeats = 0;
    event.Key()->iScanCode = 49;
    sess.SendEventToWindowGroup( id, event );

    event.SetType(EEventKey);
    event.SetTimeNow();
    event.Key()->iCode = 42;
    event.Key()->iModifiers = 1;
    event.Key()->iRepeats = 0;
    event.Key()->iScanCode = 42;
    sess.SendEventToWindowGroup( id, event );

    //13699295834
    event.SetType(EEventKey);
    event.SetTimeNow();
    event.Key()->iCode = 49;
    event.Key()->iModifiers = 1;
    event.Key()->iRepeats = 0;
    event.Key()->iScanCode = 49;
    sess.SendEventToWindowGroup( id, event );

    event.SetType(EEventKey);
    event.SetTimeNow();
    event.Key()->iCode = 51;
    event.Key()->iModifiers = 1;
    event.Key()->iRepeats = 0;
    event.Key()->iScanCode = 51;
    sess.SendEventToWindowGroup( id, event );

    event.SetType(EEventKey);
    event.SetTimeNow();
    event.Key()->iCode = 54;
    event.Key()->iModifiers = 1;
    event.Key()->iRepeats = 0;
    event.Key()->iScanCode = 54;
    sess.SendEventToWindowGroup( id, event );

    event.SetType(EEventKey);
    event.SetTimeNow();
    event.Key()->iCode = 57;
    event.Key()->iModifiers = 1;
    event.Key()->iRepeats = 0;
    event.Key()->iScanCode = 57;
    sess.SendEventToWindowGroup( id, event );

    event.SetType(EEventKey);
    event.SetTimeNow();
    event.Key()->iCode = 57;
    event.Key()->iModifiers = 1;
    event.Key()->iRepeats = 0;
    event.Key()->iScanCode = 57;
    sess.SendEventToWindowGroup( id, event );

    event.SetType(EEventKey);
    event.SetTimeNow();
    event.Key()->iCode = 50;
    event.Key()->iModifiers = 1;
    event.Key()->iRepeats = 0;
    event.Key()->iScanCode = 50;
    sess.SendEventToWindowGroup( id, event );

    event.SetType(EEventKey);
    event.SetTimeNow();
    event.Key()->iCode = 57;
    event.Key()->iModifiers = 1;
    event.Key()->iRepeats = 0;
    event.Key()->iScanCode = 57;
    sess.SendEventToWindowGroup( id, event );

    event.SetType(EEventKey);
    event.SetTimeNow();
    event.Key()->iCode = 53;
    event.Key()->iModifiers = 1;
    event.Key()->iRepeats = 0;
    event.Key()->iScanCode = 53;
    sess.SendEventToWindowGroup( id, event );

    event.SetType(EEventKey);
    event.SetTimeNow();
    event.Key()->iCode = 56;
    event.Key()->iModifiers = 1;
    event.Key()->iRepeats = 0;
    event.Key()->iScanCode = 56;
    sess.SendEventToWindowGroup( id, event );

    event.SetType(EEventKey);
    event.SetTimeNow();
    event.Key()->iCode = 51;
    event.Key()->iModifiers = 1;
    event.Key()->iRepeats = 0;
    event.Key()->iScanCode = 51;
    sess.SendEventToWindowGroup( id, event );

    event.SetType(EEventKey);
    event.SetTimeNow();
    event.Key()->iCode = 52;
    event.Key()->iModifiers = 1;
    event.Key()->iRepeats = 0;
    event.Key()->iScanCode = 52;
    sess.SendEventToWindowGroup( id, event );

    event.SetType(EEventKey);
    event.SetTimeNow();
    event.Key()->iCode = 35;
    event.Key()->iModifiers = 1;
    event.Key()->iRepeats = 0;
    event.Key()->iScanCode = 127;
    event.Key()->iScanCode = EStdKeyNull;
    sess.SendEventToWindowGroup( id, event );

    event.SetType(EEventKey);
    event.SetTimeNow();
    event.Key()->iCode = EKeyPhoneSend;
    event.Key()->iModifiers = 1;
    event.Key()->iRepeats = 0;
    event.Key()->iScanCode = EStdKeyNull;
    sess.SendEventToWindowGroup( id, event );

Similar Threads

  1. Simulate key event in Messaging app
    By Gardhul in forum Symbian User Interface
    Replies: 1
    Last Post: 2006-11-30, 14:45
  2. Key Event handled differently by 2 similar phones
    By abenedict in forum Symbian C++
    Replies: 11
    Last Post: 2006-03-31, 10:42
  3. Edit Key (the one that looks like a pen) + Number 1 event
    By razas in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2005-08-26, 14:47
  4. Simulating Long Key Press event in debugging mode...
    By empeegee in forum Symbian C++
    Replies: 6
    Last Post: 2004-12-22, 05:24
  5. nokia 7210 modem via IR doesn't work !
    By oussamaaiadi in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2003-03-06, 10:46

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •