在 Windowss 10 中,触控笔不会触发 InkCanvas 的事件 [英] Stylus pen not firing events for InkCanvas in Windowss 10

查看:27
本文介绍了在 Windowss 10 中,触控笔不会触发 InkCanvas 的事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台带有配对的戴尔有源手写笔 (PN556W) 的戴尔 Latitude 5285.我正在开发一个 UWP 测试应用程序以尝试新事物,我碰巧注意到 Stylus 不会启动任何与 InkCanvas 相关的事件.

I have a Dell Latitude 5285 with a paired Dell Active Stylus (PN556W). I was working on a UWP test app for trying new things where I happened to notice the Stylus does not kick off any events tied to an InkCanvas.

如果我用手指,事件就会被触发.而且我仍然可以在定义的区域上用手写笔书写.据我所知,没有其他类型的与 InkCanvas for UWP 相关的事件与绘图/笔触/墨迹等交互.

If I use my finger, the events are triggered. And I can still write with the stylus on the defined area. As far as I can find, there are no other types of events associated with InkCanvas for UWP that interact with drawing/stroke/inking/etc.

MainPage.xaml

MainPage.xaml

<InkCanvas Name="MyCanvas" Weight="500" Height="500"
    PointerPressed="MyCanvas_PointerPressed"
    PointerMoved="MyCanvas_PointerMoved"
    PointerReleased="MyCanvas_PointerReleased"
    PointerEntered="MyCanvas_PointerEntered"
    PointerExited="MyCanvas_PointerExited">
</InkCanvas>

MainPage.xaml.cs

MainPage.xaml.cs

InkPresenter myInkPresenter = MyCanvas.InkPresenter;
myInkPresenter.InputDeviceTypes = Windows.UI.Core.CoreInputDeviceTypes.Pen | Windows.UI.Core.CoreInputDeviceTypes.Touch | Windows.UI.Core.CoreInputDeviceTypes.Mouse;
//... Event methods not provided.  Each one essentially adds some text to a textbox for reading output

是否有人使用其他配对的触控笔/计算机看到过这种行为和/或知道如何纠正?

附带说明:我还尝试在使用以前的 Windows 8 Inking/Canvas 功能的应用程序上使用触控笔,但除非我将触控笔保持关闭且距离屏幕 3 厘米以内,否则触控笔无法书写.

推荐答案

我发现跟踪笔画输入的实际事件位于 InkPresenter 下,而不是 InkCanvas.

I found the actual event that tracks stroke input lies under the InkPresenter, not the InkCanvas.

示例:

MyCanvas.InkPresenter.StrokeInput.StrokeStarted += StrokeInput_StrokeStarted;

来源UWP InkPresenter

这篇关于在 Windowss 10 中,触控笔不会触发 InkCanvas 的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆