PDA

View Full Version : Game mouse movement



chaosgeorge
2nd December 2006, 23:33
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 :p
i know i have to use globalX and globalY but i dont get how to limit the movement with any window size
thanks

jacek
2nd December 2006, 23:41
You will have to grab the mouse with QWidget::grabMouse().