×

Discussion Board

Page 3 of 8 FirstFirst 12345678 LastLast
Results 31 to 45 of 107
  1. #31
    Nokia Developer Moderator
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,347

    Re: long keypress When program is run background??

    Quote Originally Posted by arun09 View Post
    when the program is running in emulator there is no output is this only work in phone
    See this - Running Console Applications in Carbide.c++

    But better to test the application on the device.

  2. #32
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    287

    Re: long keypress When program is run background??

    sir,
    i have written application using "SDK S60 3rd edition FP1" does it work on Nokia 6670

  3. #33
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,335

    Re: long keypress When program is run background??

    Quote Originally Posted by arun09 View Post
    sir,
    i have written application using "SDK S60 3rd edition FP1" does it work on Nokia 6670
    6670 is based on S60 2nd Edition, Feature Pack 1. And there is a binary break between S60 2nd and S60 3rd platform. So in brief and precise, you cannot run it on 6670.
    Nokia Developer Wiki Moderation team

  4. #34
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    287

    Re: long keypress When program is run background??

    sir,
    i have written an application for long keypress in SDK S60 3rd edition FP1

    i want to run it in N72 what should i do?

  5. #35
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,335

    Re: long keypress When program is run background??

    Quote Originally Posted by arun09 View Post
    sir,
    i have written an application for long keypress in SDK S60 3rd edition FP1

    i want to run it in N72 what should i do?
    As far as I know, there isn't any change in the APIs for achieving this. So you just need to build it for S60 2nd edition, FP3 SDK(because N72 is a S60 2nd edition, FP3 device).

    If you haven't installed that SDK, download it from S60 Platform SDKs ( from drop-down list, select 2nd Edition, FP3 version) and install it.

    If you have Carbide.c++ v2.0, then it does not support S60 2nd edition SDKs, officially. You can hack it as explained in this blog: http://blogs.forum.nokia.com/blog/lu...carbide.c-v1.3

    Or

    Download Carbide.c++ v1.2.2 from this link: http://www.forum.nokia.com/Resources.../Archive.xhtml

    After setting up environment, simply create a new project under S60 2nd edition, FP3 SDK and copy-paste your logic in that new project, which you have created for S60 3rd FP1 version.

    I hope this helps.
    Nokia Developer Wiki Moderation team

  6. #36
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    287

    Re: long keypress When program is run background??

    sir,
    The long keypress not working in my N72 when this code use

    Code:
    TTime iStartTime;
    TTime iEndTime;
    TTimeIntervalMicroSeconds iInterval;
    TTimeIntervalMicroSeconds minIntervalRequiered = TTimeIntervalMicroSeconds(2 * 1000 * 1000); //two seconds
    
    // connect to window server
    RWsSession ws;
    TKeyCode keyCode = EKeyApplication0;
    User::LeaveIfError(ws.Connect());
    CleanupClosePushL(ws);
    
    
    TRequestStatus status;
    
    // create a window group for the thread
    RWindowGroup wg(ws);
    wg.Construct((TUint32)&wg, EFalse);
    CleanupClosePushL(wg);
    
    
    // capture a key up and down events
    User::LeaveIfError(wg.CaptureKeyUpAndDowns(EStdKeyApplication19, 0, 0)); // scan code of camera button is EStdKeyApplication19
    
    // listen for the key presses
    ws.EventReady(&status);
    
    
    // hide this window group from the app switcher
    wg.SetOrdinalPosition(-1);
    wg.EnableReceiptOfFocus(EFalse);
    CApaWindowGroupName* wn=CApaWindowGroupName::NewLC(ws);
    wn->SetHidden(ETrue);
    wn->SetWindowGroupName(wg);
    
    
    // handle key events
    for(;;) {
    User::WaitForAnyRequest(); //wait for events
    if (status.Int()==KErrNone) { //if not error
    TWsEvent e;
    ws.GetEvent(e);
    
    TInt eventType;
    eventType = e.Type();
    
    if(eventType == EEventKeyDown){
    iStartTime.UniversalTime(); //key down time
    }
    else if (eventType == EEventKeyUp){
    iEndTime.UniversalTime(); //key up time
    iInterval = iEndTime.MicroSecondsFrom(iStartTime); //difference = duration of the press
    if (iInterval> minIntervalRequiered)
    {
    console = Console::NewL(KTextConsoleTitle, TSize(KConsFullScreen,KConsFullScreen));
    console->Write(_L("Long key press, press 5 to end daemon\n"));
    keyCode = console->Getch();
    delete console;
    }
    }
    
    // if not ours, then send to top window group
    // note that this breaks key repeat :-(
    TInt wgid=ws.GetFocusWindowGroup();
    ws.SendEventToWindowGroup(wgid, e);
    }
    ws.EventReady(&status);
    
    // stop condition
    if (keyCode == EStdKeyF11){ break; }
    }
    
    // clean up
    ws.EventReadyCancel();
    CleanupStack::PopAndDestroy(3); //ws, wg, wn

  7. #37
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,335

    Re: long keypress When program is run background??

    You are capturing Camera key in your application. It might not be the same in N72. What you should do is to create one test application which captures all keys and trace the value of camera key. Once you determine the correct key code for camera key, use that in your main application.
    Nokia Developer Wiki Moderation team

  8. #38
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    287

    Re: long keypress When program is run background??

    sir,

    what changes should be made ,so as to retrieve the keypress 2

    Code:
    TTime iStartTime;
    TTime iEndTime;
    TTimeIntervalMicroSeconds iInterval;
    TTimeIntervalMicroSeconds minIntervalRequiered = TTimeIntervalMicroSeconds(2 * 1000 * 1000); //two seconds
    
    // connect to window server
    RWsSession ws;
    TKeyCode keyCode = EKeyApplication0;
    User::LeaveIfError(ws.Connect());
    CleanupClosePushL(ws);
    
    
    TRequestStatus status;
    
    // create a window group for the thread
    RWindowGroup wg(ws);
    wg.Construct((TUint32)&wg, EFalse);
    CleanupClosePushL(wg);
    
    
    // capture a key up and down events
    User::LeaveIfError(wg.CaptureKeyUpAndDowns(EStdKeyApplication19, 0, 0)); // scan code of camera button is EStdKeyApplication19
    
    // listen for the key presses
    ws.EventReady(&status);
    
    
    // hide this window group from the app switcher
    wg.SetOrdinalPosition(-1);
    wg.EnableReceiptOfFocus(EFalse);
    CApaWindowGroupName* wn=CApaWindowGroupName::NewLC(ws);
    wn->SetHidden(ETrue);
    wn->SetWindowGroupName(wg);
    
    
    // handle key events
    for(;;) {
    User::WaitForAnyRequest(); //wait for events
    if (status.Int()==KErrNone) { //if not error
    TWsEvent e;
    ws.GetEvent(e);
    
    TInt eventType;
    eventType = e.Type();
    
    if(eventType == EEventKeyDown){
    iStartTime.UniversalTime(); //key down time
    }
    else if (eventType == EEventKeyUp){
    iEndTime.UniversalTime(); //key up time
    iInterval = iEndTime.MicroSecondsFrom(iStartTime); //difference = duration of the press
    if (iInterval> minIntervalRequiered)
    {
    console = Console::NewL(KTextConsoleTitle, TSize(KConsFullScreen,KConsFullScreen));
    console->Write(_L("Long key press, press 5 to end daemon\n"));
    keyCode = console->Getch();
    delete console;
    }
    }
    
    // if not ours, then send to top window group
    // note that this breaks key repeat :-(
    TInt wgid=ws.GetFocusWindowGroup();
    ws.SendEventToWindowGroup(wgid, e);
    }
    ws.EventReady(&status);
    
    // stop condition
    if (keyCode == EStdKeyF11){ break; }
    }
    
    // clean up
    ws.EventReadyCancel();
    CleanupStack::PopAndDestroy(3); //ws, wg, wn

  9. #39
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    287

    Re: long keypress When program is run background??

    sir,


    mwldsym2.exe: Undefined symbol: 'int E32Main(void) (?E32Main@@YAHXZ)

  10. #40
    Regular Contributor
    Join Date
    Oct 2008
    Posts
    95

    Re: long keypress When program is run background??

    what is ur exact problem ..Can u explain clearly?

    Capturing long key press is too easy ...what ur problem ..which keys r u trying to capture..?

    search for GlobalLongKeyPress.zip on wiki. It is a perfect example on how to capture long key press..

    it will help u out..

  11. #41
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    287

    Re: long keypress When program is run background??

    sir

    my problem is when 3 long press in N72 a sms is to be sent

  12. #42
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,335

    Re: long keypress When program is run background??

    Quote Originally Posted by arun09 View Post
    sir,


    mwldsym2.exe: Undefined symbol: 'int E32Main(void) (?E32Main@@YAHXZ)
    Re-read my previous post thoroughly. I asked you to perform some steps; step by step. http://discussion.forum.nokia.com/fo...5&postcount=35
    Nokia Developer Wiki Moderation team

  13. #43
    Nokia Developer Champion
    Join Date
    Oct 2006
    Location
    Bangalore, India
    Posts
    1,572

    Re: long keypress When program is run background??

    but this is not a good idea as this scenario is used by the phone for Speed Dialing also if enable, so you should be using some other mechanism !!!
    Amit Kankani
    Nokia Developer Champion

  14. #44
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,335

    Smile Re: long keypress When program is run background??

    Quote Originally Posted by amitkankani View Post
    but this is not a good idea as this scenario is used by the phone for Speed Dialing also if enable, so you should be using some other mechanism !!!
    Yes. We have known issue for this case also: KIS000708 - Applications should not capture events from numeric keys
    Nokia Developer Wiki Moderation team

  15. #45
    Nokia Developer Champion
    Join Date
    Oct 2006
    Location
    Bangalore, India
    Posts
    1,572

    Re: long keypress When program is run background??

    Quote Originally Posted by kiran10182 View Post
    great confirmation! so trying to send SMS on long press of 3 is not a good idea !
    Amit Kankani
    Nokia Developer Champion

Page 3 of 8 FirstFirst 12345678 LastLast

Similar Threads

  1. why program can not run in mobile phone ?
    By luohaibo in forum Symbian Tools & SDKs
    Replies: 9
    Last Post: 2009-03-05, 16:18
  2. Identify program running in background?
    By nire123 in forum Symbian C++
    Replies: 8
    Last Post: 2008-07-13, 07:50
  3. Can not run file manager program
    By agsapt in forum Symbian C++
    Replies: 0
    Last Post: 2002-08-27, 07:37
  4. i cannot run any java program in 9200 SDK
    By chili_fi in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2002-08-12, 23:34
  5. Run HandleSessionEventL() in background
    By chinazou305 in forum Symbian C++
    Replies: 0
    Last Post: 1970-01-01, 02:00

Posting Permissions

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