.NET DragDrop and Keyboard/Mouse Events

Gamey

21-08-2006 13:42:01

This is kind of a general .NET/GUI question. Apologies.

The editor I am dabbling with needs to handle mouse and keyboard processing during normal .NET DoDragDrop. I am trying to place one of the Ogre::Movables in 3space. I can get the XY coordinates from the mouse position, but inferring Z is tough.

My current algorithm simply finds the intersection of the mouse ray with an XZ plane that has a y coordinate of 0. That works fine if I want to place things on the "floor". I want to allow a drag and drop from my palettes to the scene and also allow for the user to spin the mouse wheel or press keys that will alter the y coordinate of the drop operation.

Unfortunately. DoDragDrop kindly squashes all keyboard and mouse events. Alternate, more specific events, are used in their stead such as DragEnter, DragLeave, DragHover, GiveFeedback, and QueryContinueDrag. None of these give me access to the general state of the keyboard or to mouse events ( in my case I really need the mouse wheel event to fire.)

First, does anyone have a better proposal for placing the object in 3space? Second, is there a way to hook the DoDragDrap message loop at some more base level? Do I have to capture the mouse myself from my drag source and do it all manually? Any and all help is greatly appreciated.

pjcast

21-08-2006 16:46:26

You can listen for movement events from one of the forms iirc (ie perhaps the form that the drag started from). So that you could place an image at the location of the mosue - or in your case, possibly update a mesh in the scene.

As for getting the position of the mouse, quite easy to do that at anytime. But, I don't think you can check the status of the wheel. myForm.PointToClient(System.Windows.Forms.Cursor.Position);

Gamey

22-08-2006 01:58:14

Thanks for the help. Pardon my ignorance, but what is "one of the forms iirc"?

pjcast

22-08-2006 03:22:51

Either the form who started the drag (sch as a treeview/listview/etc), or the form receiving the drag. I can't recal atm.

Mina

25-06-2007 02:14:38

I'm like making what you are doing, just i cant figure out a way to convert the X and Y of the mouse to X and Y that the ogre system can understand i have used the ray according to the tutorials and but there is something wrong, can u share your code where u make the drag and drop??? I'm really working on a huge project... I'm looking forward to hearing from you soon.

thanks alot


Mina