Universal Fix for Touch Keyboard on Tablets #3343
Replies: 2 comments
-
If you want to detect something like a surface keyboard being attached / disconnected to prevent the TouchKeyboard from opening (Or detecting anything really) Here's a class that appears to work well for our needs until Microsoft fixes it.
To use it put this in your App.xaml.cs and remember to get the DeviceId from the device and put it in SupportedDevices.
|
Beta Was this translation helpful? Give feedback.
-
First, thank you so much for sharing your solution! This solves one more problem, still existing in 1.4 - touch keyboard does not appear when textbox gets programmatic focus. Two things are not clear for me: calling IsTouchEnabled() every time Control got focus and existance of separate UI class. Without these, it seems to work good, but I made an Behavior based on your solution instead of attached property. |
Beta Was this translation helpful? Give feedback.
-
As of Windows App SDK 1.2 the Touch keyboard does not pop up automatically when a user taps a text entry field on Desktop when no keyboard is present, combining multiple other threads together I have put together a class that re-enables this functionality.
All you need to do is add this Dependency object to your app, go into your app.xaml and set the allowtouchkeyboard property to true.
Your App.xaml should look like this to apply it to all textboxes, password boxes, etc
Also add a class to host static UI object to reference back to
Beta Was this translation helpful? Give feedback.
All reactions