[英]How can I create simulated contacts in a surface table application without the simulator?
In a Microsoft Surface 1.0 SDK project based on WPF, I'd like to transform contacts captured in a small part of the screen to match the whole screen (like a virtual touchpad). 在基于WPF的Microsoft Surface 1.0 SDK项目中,我想转换在屏幕的一小部分中捕获的联系人以匹配整个屏幕(例如虚拟触摸板)。
After capturing a contact and transforming it's position and orientation I would like to send it back to the event queue. 捕获联系人并转换其位置和方向后,我想将其发送回事件队列。 I already figured out that there seems to be no way to create a "new Contact()" or to change anything in the "ReadOnlyContactCollection" (like it's name already says). 我已经发现,似乎没有办法创建“新的Contact()”或更改“ ReadOnlyContactCollection”中的任何内容(就像已经说过的那样)。
Here's what I was trying to do: 这是我正在尝试做的事情:
private void OnContactDown(object sender, ContactEventArgs e)
{
base.OnContactDown(e);
e.Contact.Capture(this);
// transform the contact's center and orientation
// and write them back into e.Contact via own private method
// e.Contact = transformContact(e.Contact);
// keep transformed contact in the event queue
// so it can be processed at it's new position
e.Handled = false;
}
My next idea was to make use of the simulator and automation to create SimulatedContacts, but sadly this doesn't work on the surface table itself, only in the simulator. 我的下一个想法是利用模拟器和自动化功能来创建SimulatedContacts,但可惜的是,这仅在模拟器中,不适用于表面工作台本身。
Is there any way to send out "virtual" contacts (that don't exist in the raw image) so that they will be recognized by the surface (without the use of the simulator)? 有什么方法可以发送“虚拟”联系人(原始图像中不存在),以便表面可以识别它们(无需使用模拟器)? How does the SurfaceInput.exe send out the recognized contacts? SurfaceInput.exe如何发送已识别的联系人?
Surface v1 doesn't officially support WPF 4.0, but others have figured out how to take Surface v1 input and route it into the standardized & extensible touch APIs that come with WPF 4.0. Surface v1并不正式支持WPF 4.0,但是其他人已经找到了如何获取Surface v1输入并将其路由到WPF 4.0随附的标准化和可扩展触摸API中。 Take a look at http://nui.joshland.org/2010/07/how-to-write-surface-applications-with.html for creating a custom "touch device" that transforms Surface input into WPF 4.0 input events. 查看http://nui.joshland.org/2010/07/how-to-write-surface-applications-with.html,以创建将Surface输入转换为WPF 4.0输入事件的自定义“触摸设备”。 Following that same approach, you can create another "touch device" on your own in order to pass in your fake touches. 按照相同的方法,您可以自己创建另一个“触摸设备”,以传递假触摸。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.