×

Discussion Board

Results 1 to 10 of 10

Thread: "OK" key event

  1. #1
    Registered User
    Join Date
    Jul 2009
    Posts
    34

    "OK" key event

    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
    Regular Contributor
    Join Date
    Mar 2009
    Posts
    430

    Re: "OK" key event

    Do you get any key event for that button?

  3. #3
    Registered User
    Join Date
    Jul 2009
    Posts
    34

    Re: "OK" key event

    No. I've tried EKeyEnter, EKeyTab as well, but none of them worked.

    haining

  4. #4
    Regular Contributor
    Join Date
    Mar 2009
    Posts
    430

    Re: "OK" key event

    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
    Join Date
    Jul 2009
    Posts
    34

    Re: "OK" key event

    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
    Regular Contributor
    Join Date
    Mar 2009
    Posts
    430

    Re: "OK" key event

    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
    jp4symbian
    Guest

    Question Re: "OK" key event

    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
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: "OK" key event

    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
    jp4symbian
    Guest

    Re: "OK" key event

    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
    jp4symbian
    Guest

    Thumbs up Re: "OK" key event

    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. why I can't send the key "1" event
    By songlinhe in forum Symbian
    Replies: 3
    Last Post: 2007-05-30, 08:05
  3. How to capture Pencil key up event??
    By jackchua65 in forum Symbian
    Replies: 1
    Last Post: 2007-04-18, 10:37
  4. 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
  •  
×