Results 1 to 3 of 3

Thread: How catch keypress event from hardware button for the whole application

  1. #1
    Join Date
    Dec 2009
    Posts
    62
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default How catch keypress event from hardware button for the whole application

    Hi

    I am working on a mobile application and I need to know when the user presses one of the physical buttons on the phone. I do not want this detection to be dependent on which Widget that is currently displayed or has the focus. Is there any way to detect keypress on application level independent on which is the currentl widget??

    It seems a bit hard to do installEventFilter on all of my Widgets, there must be a better way.

  2. #2
    Join Date
    Dec 2009
    Posts
    62
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How catch keypress event from hardware button for the whole application

    So I did install an event filter on my MainWindow class and I do think this one catches most of it. However if I understand correctly, if for instance a tree view also catches events this will override the filter in the MainWindow.

    The other question is really if there is a way to catch the button press when the application Window is not in focus or does this have to be done nativly on each platform, mostly interesint here are the mobile platforms like Symbian,

  3. #3
    Join Date
    Sep 2008
    Location
    Poland
    Posts
    80
    Thanks
    4
    Thanked 5 Times in 4 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: How catch keypress event from hardware button for the whole application

    As far as I remember mobile Qt applications uses QwxServer or somesuch.If I were you I'd try to reimplement the server event() function.

Similar Threads

  1. problem with keypress event and QTableView
    By ranna in forum Qt Programming
    Replies: 4
    Last Post: 24th August 2009, 16:13
  2. how to combine keypress event and mousebuttonpress event?
    By hildebrand in forum Qt Programming
    Replies: 2
    Last Post: 26th May 2009, 23:08
  3. Problem with KeyPress event and QTableView
    By ranna in forum Qt Programming
    Replies: 1
    Last Post: 16th January 2009, 20:01
  4. keypress event
    By vishesh in forum Qt Programming
    Replies: 2
    Last Post: 3rd November 2007, 14:12
  5. How to catch "ENTER" with keyPress?
    By lumber44 in forum Qt Programming
    Replies: 8
    Last Post: 30th July 2007, 16:21

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.