🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Mouse - LEFT, RIGHT, UP, DOWN????

Started by
2 comments, last by bujin 24 years ago
hello...I need a function or something to see if the mouse goes left,right,up or down... plz help...
hmm...
Advertisement
I simply don''t understand what do you want...
" de sagittis ungarorum libera nos Domine"West-European pray in 900AD
If you are in C (in VB it would be too easy ), you keep two variables which are the last position of your mouse.
Each time your mouse move, you check if the current x is lower than the last x, same with y and you know if it goes left, right up or down.

I won't explain anything about the events in C, because there are a lot of tutorials talking about them.


Edited by - Poltras on June 4, 2000 5:42:08 PM
Now I know what I'm made of, and I'm afraid of it...
You should be able to do this your self. With DirectInput it gives you the MOVEMENT of the mouse not the absolute position. So if you move the mouse up on your mouse pad DInput will return a positive number of how much you moved up. If you move it down it will return a negative number in relation to how much you moved down. Take a look at the sdk or even the on-line documentation for DInput.
See ya,
Ben
__________________________Mencken's Law:"For every human problem, there is a neat, simple solution; and it's always wrong."
"Computers in the future may weigh no more than 1.5 tons."- Popular Mechanics, forecasting the relentless march of science in 1949

This topic is closed to new replies.

Advertisement