×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    May 2008
    Location
    igala.net
    Posts
    79

    How to use keyboard?

    Hello all,

    I'm sorry if my post is double.

    Do we have a tutorial that show how to handle the keyboard of Nokia phone? I mean some thing like this:

    Code:
    	switch(lastKey){	 
    		case EStdKeyDownArrow:
    			//Do some thing;
    			
    			break;
    ___________________________
    http://AndroidCore.com

  2. #2
    Super Contributor
    Join Date
    Nov 2005
    Location
    London
    Posts
    584

    Re: How to use keyboard?

    You may find the sample chapter from the Symbian Press games book useful:
    http://developer.symbian.com/main/do...es_chapter.pdf

    The example code for that chapter can be downloaded from its website (http://developer.symbian.com/gamesbook)

    However, I don't know if it's exactly what you want, or whether you should follow it, because you don't say what version of the platform you are working on or what you want to do. If you're writing a simple gui app, it's not really appropriate. But if you're creating a game, it's OK.

  3. #3
    Regular Contributor
    Join Date
    May 2008
    Location
    igala.net
    Posts
    79

    Re: How to use keyboard?

    In the class MyAppUi : public CAknAppUi,I add a function:

    Code:
    TKeyResponse MyAppUi::HandleKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
    {
    
    	if( aType == EEventKey ){
    		lastKey = aKeyEvent.iScanCode;
    	}	 
    
    	return EKeyWasConsumed;
    }



    and in the viewer class, I add this:
    Code:
    void MyAppView::MainLoop(){
    	TInt	lastKey = AppUi->lastKey;
    	AppUi->lastKey = 0;
    	switch(lastKey){	 
    		case EStdKeyDownArrow: // do some thing
    			break;			
    		case EStdKeyUpArrow:
    
    			break;			
    		case EStdKeyLeftArrow:
    		default:
    			//gluPrintf(14, 22, 10, 80, "key");
    			break;
    	}
    }
    I don't know if this is ok or not? But It work for me.

    Rgds,
    ___________________________
    http://AndroidCore.com

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,567

    Re: How to use keyboard?

    Your code is OK.

    However if you want to support multiple keypresses at the same time, AppUi::SetKeyBlockMode can help you, then you can maintain a boolean map of keys based on EEventKeyDown and EEventKeyUp events.

Similar Threads

  1. Elektex Fabric Keyboard Bluetooth Compatibility Question
    By ekimsurfer in forum Bluetooth Technology
    Replies: 0
    Last Post: 2008-01-27, 22:36
  2. Keyboard events while 'Locked'
    By olshevch in forum Symbian User Interface
    Replies: 3
    Last Post: 2007-01-24, 13:11
  3. E61 keyboard is broken...
    By John.Holloway in forum Symbian C++
    Replies: 0
    Last Post: 2006-09-25, 11:28
  4. Developers with third party virtual keyboard software experience series 60
    By HLEW in forum News, Announcements and Job Listings
    Replies: 0
    Last Post: 2006-09-24, 00:00
  5. How do we use the Keyboard for Nokia 7110 emulator
    By Nokia_Archived in forum Mobile Web Site Development
    Replies: 1
    Last Post: 2002-05-15, 16:36

Posting Permissions

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