How to open TabTip keyboard in a UWP app in desktop mode on button click

情到浓时终转凉″ 提交于 2019-12-14 00:46:13

问题


I am currently working in a UWP application. I have a situation where I need to open the taptip keyboard. The device needs to be in desktop mode and the keyboard should open on a button click. Is there any way I can achieve this functionality?

  • I know it works fine in tablet mode when a text box gets focus but I need to get it done in desktop mode and on a button click.
  • I know it can be done from a console application using System.Diagnostics.Process but I need a way around for uwp app.

回答1:


The user can enable the tip to show when a text box gets focus in a desktop app by setting the "Show the touch keyboard when not in tablet mode and there's no keyboard attached". Apps should generally defer to the user's preferences on this rather than trying to override this themselves.

That said, you can show and hide the InputPane via the InputPane.TryShow and InputPane.TryHide methods.

You'll do essentially the same from a desktop app via the IInputPaneInterop and IInputPane2 interfaces. Launching tabtip.exe explicitly is limited and not generally recommended.



来源:https://stackoverflow.com/questions/47886654/how-to-open-tabtip-keyboard-in-a-uwp-app-in-desktop-mode-on-button-click

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!