Discussion Board

Results 1 to 10 of 10

Thread: "OK" key event

  1. #1
    Registered User hainingwu's Avatar
    Join Date
    Jul 2009
    Posts
    34
    I want to catch the key event of the "ok" key. (The key in the middle of the four arrow keys.) The document here (http://wiki.forum.nokia.com/index.ph...y_events_in_Qt) says the corresponding code should be EKeyDevice3 (63557). However, I couldn't catch the key event. I successfully caught the event of arrow keys, though. Does anyone know the reason? Thank you!

    haining

  2. #2
    Nokia Developer Champion axeljaeger's Avatar
    Join Date
    Mar 2009
    Posts
    430
    Do you get any key event for that button?

  3. #3
    Registered User hainingwu's Avatar
    Join Date
    Jul 2009
    Posts
    34
    No. I've tried EKeyEnter, EKeyTab as well, but none of them worked.

    haining

  4. #4
    Nokia Developer Champion axeljaeger's Avatar
    Join Date
    Mar 2009
    Posts
    430
    You can add a qDebug()-statement to the key handler that handle all key events before the switch and see wether it triggers. If yes, you can output the keycode and look into the header file or documentation to get the enum alias. Either way, E** do not look like Qt constants but constants from symbian. These should be avoided when developing Qt applications.

  5. #5
    Registered User hainingwu's Avatar
    Join Date
    Jul 2009
    Posts
    34
    Now I am sure the code of the OK key is 63557. I think the problem is that when the focus is on a QListWidget, I couldn't catch the event. The event was caught by QListWidget and it jumps into a new page. What I want is to jump into my desired page when the user press the OK key. How do I prevent the event to be caught by QListWidget?

  6. #6
    Nokia Developer Champion axeljaeger's Avatar
    Join Date
    Mar 2009
    Posts
    430
    You would use an eventFilter on the list widget. Btw. I strongly suggest not to use a QListWidget but a QListView and write a model for your application.

  7. #7
    Registered User jp4symbian's Avatar
    Join Date
    Oct 2006
    Location
    India
    Posts
    289
    Hi hainingwu,

    Did you get a solution to your problem? Please post it here in case you have got....

    I am facing the same issue....I need to open another page when the user selects the ListWidget item.
    But I am not getting any event at that point.

  8. #8
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    Quote Originally Posted by jp4symbian View Post
    Hi hainingwu,

    Did you get a solution to your problem? Please post it here in case you have got....

    I am facing the same issue....I need to open another page when the user selects the ListWidget item.
    But I am not getting any event at that point.
    What about listening for QListWidget::itemSelectionChanged () signal?

  9. #9
    Registered User jp4symbian's Avatar
    Join Date
    Oct 2006
    Location
    India
    Posts
    289
    Hi divanov,

    I did try with that, QListWidget::itemSelectionChanged () .

    But I want to execute some code when a list item gets selected and not when it changes (i.e on scrolling up and down arrow keys).

    I tried many other signals like itemClicked, itemPressed etc.. but these will happen on 'clicking' on the list item, and not when the item is selected and I press the OK key.

    Any suggestions?

  10. #10
    Registered User jp4symbian's Avatar
    Join Date
    Oct 2006
    Location
    India
    Posts
    289
    I have solved it finally. The answer lies here: http://discussion.forum.nokia.com/fo...466#post703466

Similar Threads

  1. Listbox problem enter key event not generated
    By electracool in forum Symbian User Interface
    Replies: 5
    Last Post: 2009-11-07, 10:22
  2. Раскладка клавиатуры в консоли
    By arkenoi in forum Russian Developer Forum - Форум Российских разработчиков
    Replies: 11
    Last Post: 2009-03-18, 18:27
  3. why I can't send the key "1" event
    By songlinhe in forum Symbian C++
    Replies: 3
    Last Post: 2007-05-30, 08:05
  4. How to capture Pencil key up event??
    By jackchua65 in forum Symbian C++
    Replies: 1
    Last Post: 2007-04-18, 10:37
  5. Replies: 1
    Last Post: 2006-10-10, 08:28

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