AB4D Forum

Full Version: Mouse behaviour with DXViewportView
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
We have implemented a mechanism to select 3D objects from an Orthographic view. The selection works fine but we have found that clicking the mouse more than once without moving it does not generate a click event.

We could live with this if it weren't for the fact that the same behaviour is observed when you zoom the image (using the mouse wheel) and click again (all without moving the cursor position) This happens even when the zoom action results in the cursor being over a different object.

To summarise:

Click left mouse button => event raised
Click left mouse button => <no response>
Move mouse slightly
Click left mouse button => event raised


Click left mouse button => event raised
Roll mouse wheel
Click left mouse button => <no response>

The WPF user control contains a DXViewportView, a TargetPositionCamera and a MouseCameraController.

Any suggestions will be welcomed.
I was not able to reproduce the problems.

I tried with slightly modifying the PowerToys\EventManagerDragSample sample that comes with Ab3d.DXEngine and the click events are always triggered there.

I assume that you are using EventManager3D to get click events.

I would advice you to check the following:
1) Check that you set CustomEventsSourceElement property on EventManager3D to a DXViewportView or even better a parent Border - that element must have Background set (it can be Transparent but should not be null). Thous this is probably not a problem, because you get some events.

2) Do you change the model significantly after the first click? It is ok to just change the material, but if you change the Model3D or MeshGeometry3D, then the next click might be still registered to the old Model3D - in this case check why the click works again when the mouse is moved.

3) Comment registering events with EventManager3D and manually subscribe to MouseDown and MouseUp on the CustomEventsSourceElement. In the MouseUp call your code that is called in Click event. See if you get both events. If not, try to find out why WPF would not trigger those events.

4) You might try to set the UsePreviewEvents property on EventManager3D to true - this will subscribe to Preview... events instead of standard events.

If none of this will help, I would ask you to prepare a simple sample application that can be used to reproduce the problem. Then send me the sample with feedback form (http://www.ab4d.com/Feedback.aspx)
Thanks for the quick response.

I will check the items you mentioned but can confirm that we do not alter the model between clicks (the current functionality is read-only)