[英]Manually trigger on-screen keyboard in Windows Universal App on Windows 10 IoT Core?
For some reason the on-screen keyboard in Windows 10 IoT Core on raspberry pi 2 model b does not always come to front. 由于某些原因,树莓派2型b的Windows 10 IoT核心版中的屏幕键盘并不总是在前面。 (actually 99% it does not work).
(实际上99%无效)。
is is possible to manually make a call in codebehind (for example when the OnFocus event happens) to show the osk? 是否可以手动在后台代码中进行调用(例如,发生OnFocus事件时)以显示osk?
The osk is actually a separate program, you could call it using the External Process Launcher API. osk实际上是一个单独的程序,您可以使用External Process Launcher API对其进行调用。
https://developer.microsoft.com/en-us/windows/iot/samples/externalprocesslauncher https://developer.microsoft.com/zh-CN/windows/iot/samples/externalprocesslauncher
From what I understand it is only available on Windows SDK: Version 15063 and up however. 据我了解,它仅适用于Windows SDK:版本15063及更高版本。
I don't have the SDK installed at work so this code may be wrong, but it would look a bit like this: 我没有在工作时安装SDK,因此此代码可能是错误的,但看起来有点像这样:
var result = await ProcessLauncher.RunToCompletionAsync("C:\\Windows\\System32\\osk.exe", string.Empty);
Edit: 编辑:
I'm thinking this may block the UI Thread though, which would be undesirable. 我在想这可能会阻止UI线程,这是不可取的。 Maybe if you run the task in the background though... Perhaps through the CoreDispatcher.
也许如果您在后台运行任务……也许通过CoreDispatcher。
https://docs.microsoft.com/en-us/uwp/api/Windows.UI.Core.CoreDispatcher#Windows_UI_Core_CoreDispatcher_RunAsync_Windows_UI_Core_CoreDispatcherPriority_Windows_UI_Core_DispatchedHandler_ https://docs.microsoft.com/zh-cn/uwp/api/Windows.UI.Core.CoreDispatcher#Windows_UI_Core_CoreDispatcher_RunAsync_Windows_UI_Core_CoreDispatcherPriority_Windows_UI_Core_DispatchedHandler_
var ignored = dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
{
await ProcessLauncher.RunToCompletionAsync("C:\\Windows\\System32\\osk.exe", string.Empty);
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.