DirectInput using C#: mousebutton drag?

Started by
0 comments, last by circlesoft 18 years, 11 months ago
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.
--Avengers UTD Chronicles - My game development blog
Advertisement
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
Dustin Franklin ( circlesoft :: KBase :: Mystic GD :: ApolloNL )

This topic is closed to new replies.

Advertisement