I have a WPF application that uses one -ordinary- mouse but I wanna allow multi user with multi mouse to use it.
I installed Microsoft Multipoint Sdk and configured it.
But How I can use Sdk events instead of user32.dll events?
I don't think you need that.
Look into the MouseEventArgs. They all have a MouseDevice property to see which mouse caused the event.
Related
I have a somewhat unusual design problem in a WPF touch application.
I have a UserControl that holds an image, which I allow the user to freely move, resize, and rotate around the touch surface using multitouch by setting:
isManipulationEnabled = true
and then hooking up events for ManipulationStarting, ManipulationDelta, and ManipulationCompleted.
This is all good and works perfectly, but now I would like to add the ability for a user to drag this control into the WrapPanel on another control, which has a list of image files, and add this image to the list.
I tried using DragDrop events by calling DragDrop.DoDragDrop() on the ManipulationDelta event, but it locks the UI and the control until a drop occurs, which is not what I want.
Is there any way to properly do this without writing my own hit-testing code? I'm using WPF 4.0 and .NET 4.5 on VS 2013, and I'm not sure if the Surface SDK would help me in this case (nor could I properly install/load it to VS2013)
Found my solution: Use VisualTreeHelper.HitTest and call the HitTest in the event handler for ManipulationDelta, and then use your own logic for handling the drag over operation. Use ManipulationCompleted event to check the hit test again to complete the drop
When the user selects a text anywhere in any application,I want to capture the selected text.
i wont to capture automatically the selected text.with out using Clrt + C.
can i do that ?
You may be able to use global windows hooks such as WH_MOUSE_LL to capture the mouse events.
A possible solution would be to capture the mouse up event, WM_LBUTTONUP, through the global windows hooks and then trigger a copy to the clipboard (such as programatically sending a ctrl+c)
This link gives an example of hooking into global windows events. This specific one is for keyboard events however it should be similar for mouse events.
Using global keyboard hook (WH_KEYBOARD_LL) in WPF / C#
This link contains suggestions for triggering os level copies to the clipboard.
Trigger OS to copy (ctrl+c or Ctrl-x) programmatically
This is neither an elegant solution or a complete solution as it will try to copy after every mouse click regardless of whether text is highlighted, but hopefully can be used as a starting point.
I am using C#, Silverlight, WP7.
What is the difference between a Tap event and the sequence of MouseLeftButtonDown and MouseLeftButtonUp events? Also why doesn't a Tap event always trigger MouseLeftButtonDown/MouseLeftButtonUp in sequence? Are these events any different in simulation on the computer and deployed on a phone?
I can't find this in the documentation and my own tests seem to imply that a really quick click on the screen won't always generate a MouseLeftButtonDown/MouseLeftButtonUp sequence. Are these mutually exclusive events? If not, what is the order of events?
Thanks in advance.
Although the mouse events are available on WP7, they are not necessarily reliable.
User input in Windows Phone includes manipulation events, mouse
events, and touch events.
Manipulation events are the recommended way to handle user input. Unless you have a specific need, you should avoid using mouse events
in your Silverlight applications for Windows Phone for performance and
hardware compatibility reasons. Instead, you should use manipulation
events. You can also use Tap, DoubleTap, and Hold events on any
elements that derive from UIElement such as the base controls.
http://msdn.microsoft.com/en-us/library/ff967560%28v=VS.92%29.aspx
I want to implement touch event in my Win-Form application. Touch events for buttons, list, combo box and check box. Any idea how do I implement it ? I couldn't find any resources for the same.
I just want my application to be completely compatible with the touch screen Tablets. I use .NET 3.5 and don't see any relevant event handlers. Am I missing any thing ?
I think you are missing something.
I think the "touch" event you are looking for is in fact a "single click" if running win forms on a tablet.
Handle the OnClick event.
You can do so by using Selecting event handler dor respective controls
I wrote a low-level mouse hook in C#, which should capture XBUTTON events. For the 1st and 2nd xButton it works just fine, but there is no message for the 3rd xButton on my mouse. It seems like there is no possible way to capture events for that button?
I have a gaming mouse and there, between the two first xButtons, is a third xButton. When I click it, nothing happens, so I wanted to write a custom C# Mouse-Hook app to program a custom behaviour for that button...
That's correct. The third X-button is handled by your mouse drivers, not by Windows itself. Windows doesn't have built-in knowledge of or support for more than two X-buttons. Those additional buttons wouldn't do anything at all without special drivers installed.
You need to find out how to communicate with your mouse driver software. That's the only way to get notifications when those buttons are clicked.