Skip to main content
gamedev.net
🔒 Locked

DirectInput.MouseState

Started by TriSwords 1 reply 600+ views
Original Post
TriSwords
TriSwords
EDIT I found my problem, when I created my mouse input device, I make it a keyboard, not a mouse. I do have a question though. Is there a way to get the X and Y coor on the screen. Like the absolute value from the 0,0 from the windows corner. DirectInput.MouseState state = mouse.CurrentMouseState; only returns how far the mouse has moved. For example, if the mouse is in the middle of a 800 x 600 screen, it returns 400,300 as the mouse point. Or would I need to write my own method to do this? Thanks TS [Edited by - TriSwords on December 20, 2004 11:35:11 PM]
Supernat02
Supernat02
The easiest thing to do is use Windows messaging for the x,y position of the mouse. DirectInput wasn't made with that particular purpose in mind and it can be an inaccurate mess trying to use it for x,y coordinates on the screen. :)

Good luck,
Chris
Chris ByersMicrosoft DirectX MVP - 2005
ms291052
ms291052
POINT p;
GetCursorPos(&p);

DWORD x = p.x;
DWORD y = p.y;

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.