🎉 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????
hello...I need a function or something to see if the mouse
goes left,right,up or down...
plz help...
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
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
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
See ya,
Ben
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement