• Advertisement
Sign in to follow this  

help me with input please

This topic is 4770 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi there guys, i decided to use direct input in my application. but it turns out that the mouse's coordinates are in a relative form. and even when the mouse cursor reach the edge of the screen, the mouse state keeps on changing. i know that the state can be in a absolute mode, but the coordinates of the mouse are weird(these numbers are in a mess). and when the mouse move out of the window form, they won't stop too. in my application, i want to get precise coordinates according to the left edge and top edge of the main form, so i can add the feature of picking 3D objects from a 3D environment. how can i get the precise coordinates that i desired(the position of the mouse cursor is random when the programme start and the window size is flexible, so it is tough to calculate the accurate position of the mouse sprite in the window form)? sorry for my poor english and thank you.

Share this post


Link to post
Share on other sites
Advertisement
Sorry I don't have my code handy but there is a call to get the coordinates based on your current view port. Actually you don't need direct input for the WM_MOUSE in message in windows works fine for me.

Share this post


Link to post
Share on other sites
WM_MOUSEMOVE is often fine, but it's not well suited to things like first person shooters, where you need instant feedback.

You need to work out the position of the cursor yourself. The values you're getting are indeed relative, but they're not in pixels, they're in mickies (Or however you spell it), that is mouse values. You're responsible for converting that value into pixels, and clamping the values so they don't go outside yoru screen. You can often use a fixed sensitivity, but you can also get the mouse sensitivity the user has selected in the Control Panel (But I'm not sure how, I think it's just reading a registry key).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement