简体   繁体   中英

On-screen keyboard in Windows Universal App on Windows IoT?

Is it possible to show the On-Screen Keyboard (osk) in a Windows Universal App on Windows 10 IoT Core? The raspberry pi only has a mouse attached and when I click on a textbox I'd like to show the osk.

I can set the InputScope and IsTextPredictionEnabled but can't figure out how to trigger the osk to show.

There is an example here of an on screen keyboard. If you look at the sample they are using one in their web browser. This is a pretty good keyboard but it would be better to have the default windows keyboard

https://github.com/ms-iot/samples/tree/develop/DigitalSign

If it was up to me I would prefer the default OSK since you can specify slightly different keyboard layouts based on inputs. I don't like this one because the text box loses focus which can limit the use of action listeners that you can use. Hopefully this is something that gets enable in future builds but for now this is a pretty good keyboard you can steal so you don't have to start from scratch.

On a side note you should upvote in Windows Feedback under "Developer Platform/ Windows 10 IoT Core". There should be a suggestion open.

I asked that question back in July on the MSDN forums. The answer that I got was:

"This has been answered here:

https://social.msdn.microsoft.com/Forums/en-US/d81ebfa0-ccdc-479e-8e2f-bc921de17343/onscreen-keyboard?forum=WindowsIoT

There's no onscreen keyboard available at the moment. There's the possibility that one will be added later, but it's not guaranteed. If you read the linked post you also find an explanation as to why none is available."

Just for reference, here's the link to the MSDN question that I asked: https://social.msdn.microsoft.com/Forums/en-US/9c95f424-f0ca-4751-9497-a019c1d40907/touch-keyboard?forum=WindowsIoT

And here's the answer from the linked post:

"At the moment there is no On-Screen Keyboard available. If you want a user to input something via the screen then you'll want to provide the UI for that input in your application. Part of the reason for this is that we don't have a 'shell' like explorer that is there helping control what app is running or providing other services such as SIP / OSK as is handled on the desktop.

Longer term I believe this is something that the product team is considering / looking into but I do not have any timeline on if or when it might be an option (if ever). If I learn otherwise I will let you know.

I hope that helps."

From https://social.msdn.microsoft.com/Forums/en-US/d81ebfa0-ccdc-479e-8e2f-bc921de17343/onscreen-keyboard?forum=WindowsIoT : -

There is one available (I think since 14986). You have to enable it in the device portal under "Device Settings" > "On-screen Keyboard".

Thursday, January 05, 2017 12:57 PM

本答案中所述 ,如果您有最新版本,请从Windows设备门户中检查屏幕键盘。

I wanted to post the workaround that I came up with, but I didn't have enough rep points yet to include more than 2 links. So I'm posting it as another answer.

Here it is: And for those interested, I wrote up a very basic example of a osk-UI element. The Idea was to create something that could be reused if necessary. It's also not the fastest thing but maybe it will give you ideas. Its basically a UserControl inside a Popup. When a Textbox gets focused, it fires an event that sets the "Keyboard Popup"'s DataContext to that of the Textbox and shows the "Keyboard".

I dropped it into a .zip file and uploaded it to my Box.com account.

Here's the project folder: https://app.box.com/s/vsf1wclaivsan4hhu2u2qdrb2awnbspu

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM