开发者

Faking WPF Manipulation Events

开发者 https://www.devze.com 2023-02-11 10:08 出处:网络
I want to fake manipulation (or touch) events using a mouse / keyboard. When I try to raise the events usi开发者_如何学JAVAng:

I want to fake manipulation (or touch) events using a mouse / keyboard. When I try to raise the events usi开发者_如何学JAVAng:

RoutedEventArgs e = new RoutedEventArgs(ManipulationStartedEvent,this);
RaiseEvent(e);

Gives me the error "Cannot convert RoutedEventArgs to ManipulationStartedEventArgs, and attempting to create a new ManipulationStartedEventArgs results in an error as there are no constructors for ManipulationStartedEventArgs.

Is it possible to do this?


So the answer is to create a Custom Touch Device by extending the Touch Device class with appropriate mouse inputs.

An example using Microsoft Multipoint SDK (Multi-Mouse).

0

精彩评论

暂无评论...
验证码 换一张
取 消