Results 1 to 5 of 5

Thread: Get mouse events in MAC

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2011
    Posts
    120
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    33

    Default Re: Get mouse events in MAC

    we need to get the mouse up event on Application's Title bar in Windows and MAC OS.In window we got the solution,but in MAC we don't know how to get mouse up event on Title bar.
    Qt Code:
    1. //Function for getting Mouse Event on TitleBar in Windows.
    2.  
    3. #ifdef Q_OS_WIN
    4. bool RightSideBar::winEvent(MSG *msg, long *result)//This function working fine in our application
    5. {
    6.  
    7. switch (msg->message)
    8. {
    9.  
    10. case 562:
    11. {
    12. qDebug()<<"Using Windows API Mouse Button UP"<<msg->message;
    13. return false;
    14. break;
    15. }
    16.  
    17.  
    18. }
    19.  
    20. return false;
    21. }
    22. #endif
    23. //End Function for getting Mouse Event on TitleBar in Windows.
    24.  
    25.  
    26. //Function for getting Mouse Event on TitleBar in MAC.
    27. #ifdef Q_OS_MAC
    28. bool RightSideBar::macEvent(EventHandlerCallRef caller, EventRef event)
    29. {
    30. qDebug()<<"Inside MAC event.....";//we dont know how to get mouse event here
    31. return false;
    32. }
    33. #endif
    To copy to clipboard, switch view to plain text mode 

    please help us..
    Last edited by vinayaka; 31st January 2012 at 07:11.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: Get mouse events in MAC

    I Googled the docs for you: Cocoa Event-Handling Guide: Handling Mouse Events. This is nothing to do with Qt.

    The process probably goes something like this:
    • Use EventRef to get NSEvent *
    • Use NSEvent to check event type and get relevant mouse information

    How you do that from C++ I don't know.

  3. The following user says thank you to ChrisW67 for this useful post:

    vinayaka (31st January 2012)

Similar Threads

  1. Replies: 3
    Last Post: 8th October 2011, 10:46
  2. Mouse events
    By Maluko_Da_Tola in forum Newbie
    Replies: 3
    Last Post: 25th August 2010, 07:55
  3. Mouse Events
    By daviddoria in forum Qt Programming
    Replies: 6
    Last Post: 13th May 2008, 12:55
  4. mouse events
    By xyzt in forum Newbie
    Replies: 3
    Last Post: 23rd March 2008, 12:14
  5. mouse moving don't produce mouse events
    By coralbird in forum Qt Programming
    Replies: 1
    Last Post: 13th September 2006, 07:13

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
  •  
Qt is a trademark of The Qt Company.