Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User seera's Avatar
    Join Date
    Sep 2006
    Posts
    26
    Hello.

    I make a console program.
    It works good in emulator.(input is 'a' key -> result is print screen)

    But, After I install console program in phone, execute the console program, and press any key then the console program exit.

    My question is
    How to catch the key event in console program?

    Give some direction to me.
    Thanks in advance.

  2. #2
    Registered User marvik_34's Avatar
    Join Date
    Jun 2006
    Posts
    259
    Hi,

    Try with TKeyCode code =console->Getch();

    Cheer's

  3. #3
    Registered User seera's Avatar
    Join Date
    Sep 2006
    Posts
    26
    I already did like that.

    input = console->Getch();

    But, It's not working..

    How can I get a key event in console?

  4. #4
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    It is really bad for you, since CConsoleBase::Getch works for everybody else.

  5. #5
    Registered User marvik_34's Avatar
    Join Date
    Jun 2006
    Posts
    259
    Hi Seera,

    Can you post the code you have written, it's easyer to find the mistakes. Some one in the forum will certainly helps you.

    Cheer's

  6. #6
    Registered User seera's Avatar
    Join Date
    Sep 2006
    Posts
    26
    Thanks all... ^^
    Here is.
    My program is
    if you execute the program, you can show the main menu.
    And press the 'a' key then you can show the submenu.

    It works good at emulator.
    But, when i execute the program in the phone(Nokia73),
    I can show the main menu. but if i press any key, just program exit.

    It based on Symian 3rd edition.

    ---------------------------------------------------------
    class CTestClass
    {
    public:
    CTestClass();
    ~CTestClass();

    static void test();
    };

    GLDEF_C TInt E32Main() // main function called by E32
    {
    __UHEAP_MARK;
    CTrapCleanup* cleanup=CTrapCleanup::New();
    TRAPD(error,callTestMainL()); // more initialization, then do example
    __ASSERT_ALWAYS(!error,User::Panic(KTxtEPOC32EX,error));
    delete cleanup; // destroy clean-up stack
    __UHEAP_MARKEND;
    return 0; // and return
    }


    void callTestMainL() // initialize and call example code under cleanup stack
    {

    console=Console::NewL(KTxtExampleCode,TSize
    (KConsFullScreen,KConsFullScreen));
    CleanupStack::PushL(console);
    TRAPD(error, CTestClass::test());
    if (error)
    console->Printf(KFormatFailed, error);
    else
    console->Printf(KTxtOK);
    User::After(3000000);
    CleanupStack::PopAndDestroy(); // close console
    }


    void CTestClass::test()
    {
    TKeyCode input ;

    do
    {
    displayMainMenu();
    input = console->Getch() ;

    console->SetPos(0);
    console->Printf(_L("Your Input = %c\n\n"), input);

    if ( input == 'a') //sub menu a
    {
    displaySubAMenu();
    doSubAMenu();

    }
    } while (input != EKeyEscape) ; //End DO

    }

Similar Threads

  1. not getting send (call or green) key event
    By vasant21 in forum Symbian C++
    Replies: 2
    Last Post: 2007-01-09, 17:31
  2. background program capture key input
    By jackxie in forum Mobile Java General
    Replies: 1
    Last Post: 2006-07-03, 16:26
  3. ** Important ** Event bug in phone and emulator.
    By fnagaton in forum Symbian C++
    Replies: 8
    Last Post: 2003-07-11, 12:56
  4. Key Event Issues
    By mykes in forum Symbian C++
    Replies: 0
    Last Post: 2003-05-01, 10:55
  5. Key event not working in 7650 simulator
    By hillcast1 in forum Mobile Java General
    Replies: 1
    Last Post: 2002-12-15, 14:47

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved