Discussion Board

Results 1 to 5 of 5

Thread: softkeys in Qt

  1. #1
    Registered User prathibha83's Avatar
    Join Date
    Feb 2010
    Posts
    46
    how to handle left ,right softkeys and up,down,etc keys...

  2. #2
    Nokia Developer Champion kiran10182's Avatar
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,236
    Check this: http://wiki.forum.nokia.com/index.ph...Qt_for_Symbian

    And search similar terms in Forum Nokia Wiki for other results.
    Nokia Developer Wiki Moderation team

  3. #3
    Nokia Developer Champion danhicksbyron's Avatar
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209
    Unfortunately the term "softkeys" has different meanings to different people. If you're referring to the keyboard up/down/left/right keys on a Symbian platform:
    Code:
    enum SymbianKeyCodes {
    	KeyLeftArrow = 63495,
    	KeyRightArrow = 63496,
    	KeyUpArrow = 63497,
    	KeyDownArrow = 63498
    };
    
    void QDataEntryColumn::keyPressEvent(QKeyEvent* event) {
    	QString key = event ->text();
    	if (allowKeyboard) {
    		if (key.size()) {
                            handleKey(key);
    			return;
    		}
    		else if (event ->key() == Qt::Key_Tab) {
    			// We never appear to get here
    			emit right();
    			return;
    		}
    		else if (event ->key() == Qt::Key_Backtab) {
    			// we never appear to get here
    			emit left();
    			return;
    		}
    #ifdef  Q_OS_SYMBIAN
    		else if (event ->nativeVirtualKey() == KeyLeftArrow) {
    			emit left();
    			return;
    		}
    		else if (event ->nativeVirtualKey() == KeyRightArrow) {
    			emit right();
    			return;
    		}
    		else if (event ->nativeVirtualKey() == KeyUpArrow) {
    			emit up();
    			return;
    		}
    		else if (event ->nativeVirtualKey() == KeyDownArrow) {
    			emit down();
    			return;
    		}
    #endif
    	}
    	QWidget::keyPressEvent(event);
    }

  4. #4
    Nokia Developer Champion kiran10182's Avatar
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,236
    There is a code snippet from FN. Check this also: CS001352 - Listening for Symbian key events in Qt
    Nokia Developer Wiki Moderation team

  5. #5
    Nokia Developer Champion danhicksbyron's Avatar
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

Similar Threads

  1. Qt for Symbian development resources
    By liuxg in forum [Archived] Qt General ( Qt技术)
    Replies: 55
    Last Post: 2011-01-26, 04:06
  2. automatic rotate screen on meamo
    By fily_love in forum Nokia N9
    Replies: 27
    Last Post: 2010-04-06, 08:37
  3. gsreamer-0.10-plugins-good+Phonon
    By niqt in forum Nokia N9
    Replies: 10
    Last Post: 2010-03-05, 09:56
  4. kinetic scrolling
    By stalep in forum Nokia N9
    Replies: 10
    Last Post: 2009-12-08, 12:41
  5. Senior QT Client Developer (Dublin, Ireland)
    By marynyc in forum News, Announcements and Job Listings
    Replies: 0
    Last Post: 2009-06-02, 18:24

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