Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Win universal app Windows.UI.Core.CoreWindow.PointerPosition_Win Universal App_Windows 10 Universal - Fatal编程技术网

Win universal app Windows.UI.Core.CoreWindow.PointerPosition

Win universal app Windows.UI.Core.CoreWindow.PointerPosition,win-universal-app,windows-10-universal,Win Universal App,Windows 10 Universal,我正在编写一个Windows10通用应用程序。我使用Windows.UI.Core.CoreWindow.PointerPosition每30毫秒读取一次指针位置。它在桌面上工作得很好,但在只有触摸界面的平板电脑上(Windows 10家庭安装)不起作用-为什么会这样?我可以通过什么方式读取指针位置,使它在平板电脑的桌面上工作?我知道我可以使用eventUIElement.PointerMovedevent,但这需要更改大量代码,因此,我更喜欢一些允许读取DispathcerTimer tick

我正在编写一个Windows10通用应用程序。我使用
Windows.UI.Core.CoreWindow.PointerPosition
每30毫秒读取一次指针位置。它在桌面上工作得很好,但在只有触摸界面的平板电脑上(Windows 10家庭安装)不起作用-为什么会这样?我可以通过什么方式读取指针位置,使它在平板电脑的桌面上工作?我知道我可以使用event
UIElement.PointerMoved
event,但这需要更改大量代码,因此,我更喜欢一些允许读取DispathcerTimer tick事件中指针位置的方法/属性,比如
Windows.UI.Core.CoreWindow.PointerPosition

尝试在
PointerPressed
事件上启动计时器,在
PointerReleased
事件上停止。这将有助于解决您的问题?嗯,没有指针,是吗?用户的食指不会一直按在玻璃上。