Tablet W8: how to open keyboard when an Texteditor is selected?


#1

I have made a small app that should work on a windows 8 tablet. Wen selecting a texteditor the keyboard should open automatically. How can I do this? Any hints?

Thank you!


#2

This seems to be coming up a lot even in straight Win32 development. As far as I could tell, there is no Win32 API to open or close the keyboard. So I did some searching that started here:

https://software.intel.com/en-us/blogs/2013/06/11/touch-keyboard-access-for-windows-8-desktop-apps

I then put an #ifdef in the members for the control getting and losing focus. If I am on Windows 8, open the keyboard indirectly, or find a Window of the right class and send it a close message to make it go away. It's still a bit kludgy, I search to see if there HID keyboard device attached at startup to decide if the soft keyboard should be shown.

If someone has a better approach, I'd love to hear about it!