Results 1 to 2 of 2

Thread: Game mouse movement

  1. #1
    Join Date
    Nov 2006
    Posts
    41
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Game mouse movement

    Hi there, im developing a simple opengl game and im using the mouse position (x() and y()) to move a shape, i can do this only when the mouse is inside the widget thats ok but how can i let the shape move even if the mouse is outside? i mean by example the sape has reached the Y boundaries however i want it to still move the sape along X axis even if the mouse is outside the widget so the user dont feel like the shape just stoped moving when the mouse got outside and can do fast moves without loosing the control of the shape
    i know i have to use globalX and globalY but i dont get how to limit the movement with any window size
    thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Game mouse movement

    You will have to grab the mouse with QWidget::grabMouse().

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

    chaosgeorge (3rd December 2006)

Similar Threads

  1. mouse moving don't produce mouse events
    By coralbird in forum Qt Programming
    Replies: 1
    Last Post: 13th September 2006, 06:13
  2. Replies: 2
    Last Post: 24th July 2006, 18:36
  3. QStackerWidget and mouse events
    By high_flyer in forum Qt Programming
    Replies: 3
    Last Post: 25th April 2006, 19:25
  4. setCanvas blocks mouse movement on QtCanvasView
    By YuriyRusinov in forum Qt Programming
    Replies: 8
    Last Post: 20th April 2006, 07:38

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.