如何在没有模拟器的情况下在表面表应用程序中创建模拟接触?

发布于 2024-10-18 09:08:17 字数 810 浏览 5 评论 0原文

在基于 WPF 的 Microsoft Surface 1.0 SDK 项目中,我想转换在屏幕的一小部分捕获的联系人以匹配整个屏幕(如虚拟触摸板)。

捕获联系人并转换其位置和方向后,我想将其发送回事件队列。我已经发现似乎无法创建“new Contact()”或更改“ReadOnlyContactCollection”中的任何内容(就像它的名称已经说明的那样)。

这就是我想做的:

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;
}

我的下一个想法是利用模拟器和自动化来创建 SimulatedContacts,但遗憾的是这不适用于表面表本身,只能在模拟器中使用。

有没有办法发送“虚拟”联系人(原始图像中不存在),以便它们被表面识别(不使用模拟器)? SurfaceInput.exe如何发送识别出的联系人?

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).

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).

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.

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

九公里浅绿 2024-10-25 09:08:17

Surface v1 并未正式支持 WPF 4.0,但其他人已经找到了如何获取 Surface v1 输入并将其路由到标准化和 WPF 4.0 的方法。 WPF 4.0 附带的可扩展触摸 API。看看 http://nui.joshland .org/2010/07/how-to-write-surface-applications-with.html 用于创建将 Surface 输入转换为 WPF 4.0 输入事件的自定义“触摸设备”。按照相同的方法,您可以自己创建另一个“触摸设备”,以传递您的假触摸。

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. 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. Following that same approach, you can create another "touch device" on your own in order to pass in your fake touches.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文