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 dis开发者_运维技巧play, 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?
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.
精彩评论