Sign in to follow this  

DirectInput using C#: mousebutton drag?

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

Hello there, I've been experimenting with DirectInput but I've been unable to discover whether a mousebutton is being dragged. Currently, I'm only able to manage events that happen when the mousebutton is clicked. So if I press and hold a button, the associated event is run only once, and I'm unable to manage drag events. I've also experimented with the bufferedData mode, but it seems a bit ankward to manage mousebutton drag action in this way... In fact this kind of action should add two item in the collection, the button down event and the button released event (if I'm not mistaken).. Am I supposed, in the event of a button pressed event, to search the rest of the collection for that same button released event? I suppose that is not the right way to do it and that there must be some simpler way.. I noticed that there are some kind of "presets" (or something like that) in the DirectInput namespace for various kind of games like soccer and driving games, and there isn't a way to handle mouse drag events? :D (I'm managing events using the SetEventNotification method as shown in the tutorials) Thanks in advance.

Share this post


Link to post
Share on other sites
DirectInput doesn't offer too much functionality, besides button on/off and axis movement, for the mouse. So, you are going to have to either:

(a) Write your own routines for identifying when a mouse is being dragged. For example, when you are using Immediate Mode, keep the mouse state from last frame. It the mouse button is still down, and the mouse has moved, then it is being drug.

(b) Use Windows messages

Share this post


Link to post
Share on other sites

This topic is 4596 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this