Jump to content
  • Advertisement

Archived

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

malpass

mouse_event() is clicking wrong place

This topic is 5528 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

I use the mouse_event to send messages to the system and it works fine, but after a while it starts clicking the wrong place. I''ve tryed using the abolute setting with the WM_LBUTTONDOWN or which ever message it is u usually pass (can''t remember off top of my head) and it still clicks the wrong place. Is there a way I can tell it just just send a click to whereever the mouse is currently then I could just use SetCursorPos() before it.

Share this post


Link to post
Share on other sites
Advertisement
You may be having trouble with the system giving you mouse coordinates in client/screen coordinates. To convert between the two, use these functions:

ClientToScreen()
ScreenToClient()

-Mike

Share this post


Link to post
Share on other sites
oh, iv found out the error, well i think i have. The button i used to start it was Ctrl+S, which called the Save function on the app it was running for and that screwed with the mouse.

It seems fine now, but an error a came accross many times was that for no reason it would all of a sudden make the mouse run really slow for a few seconds then the app would stop running, it would maximize and minimize all that like, not like a crash, but the timers that were set werent running. Then the second I pressed ANY key it all unfroze and continued. I think this may be some sort of clog in the Keyboard Hook ? anybody clarify?

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!