Archived

This topic is now archived and is closed to further replies.

Direct-input Mouse coords how subdue?!

This topic is 5797 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, I''m working current on a Direct3d based GUI and i use Direct-input for all the input exercises. So every GUI control has is own coordinates (sure *g*), so and wenn i would get the mouse coordinates, i became the relative distance from the last coordiante, fine, but how can i become the real cordinates, that i need to find out, whether the mouse is over some control or not. And a second problems came across, when i run my application in windowe mode, the coordinates matched not at all. What should i do, or better what did i wrong *g* Thanks alot... Mfg Impz0r

Share this post


Link to post
Share on other sites
Well, I suppose you draw your own cursor so why not just
use a structure like this:

  
struct
{
int x, y,
dx, dy;
float fac;
} sMouse;


You initialize sMouse.x and sMouse.y with whatever values you
want and update them according to dx and dy:

  
sMouse.x += (int)((sMouse.dx * fac) + 1.0f);
sMouse.y += (int)((sMouse.dy * fac) + 1.0f);


This not only allows you to "lock" the mouse at your wish by
clipping x and y, you also can achieve different mouse
velocities.

Share this post


Link to post
Share on other sites
hi, thank your for your replay *g*
Is there a way to notice if the cursor over the current app window, and set then the cursor per Direct-Input to default position?! or better reset the Diret-Input values such a thing :D ?!

Thanks alot...

Mfg Impz0r

Share this post


Link to post
Share on other sites