views:

37

answers:

1

Do any1 know how to remove mouse event, but allow only touch events.

In brief, I have 2 monitors. 1 is the primary display, another is a touch screen.

I don't want the mouse cursor to move over to the second display. For the display, it will only accept touch events, so hopefully, when the 2nd screen is touched, the mouse should stay at the primary screen w/o moving.

Any idea how to do that?

A: 

Not with Windows, because all mouse-like device inputs get combined to one virtual device. So if your touchscreen is registered as and acts like a regular mouse, I know of no way to find out where the input came from. Only solution here would be getting the input data at driver level. (See the several results for c# multiple mice.)
Because of this the mouse cursor will always (shortly) move to where the touchscreen is "clicked".

Preventing the mouse cursor to enter the second screen will be quite difficult, because that also happens at Windows level.

I suggest a workaround, although this depends on your touchscreen:
Usually touchscreen inputs (though not stylus inputs) have a very short / fast mouse move before the click. So one possible solution would be to listen to mouse move events and separate the input's origin using that information.

Martin
I have actually thought to use the latter method that you mention,declare a lastPosition variable to capture position when onMouseMove event trigger. So if the position is at 2nd screen, after the click event when touchscreen is clicked, I move it back.U think is viable?Anyway thanks for the clarification
C_Rance