I have an app that needs a virtual keyboard. But, when I click some of my TextBox
es, they don't make the virtual keyboard appear. I have tried using this:
System.Diagnostics.Process.Start("osk.exe");
But this opens another keyboard, one that does not close after the TextBox
has no focus. How to force win10 to open the virtual tablet keyboard?
To make myself clear:
This is running on a win10 touch screen PC. When I have the tablet mode enabled the virtual keyboard shows up on some TextBox
es and does not on others. Hence why I want to force the keyboard to show.
EDIT: I have since found a way to show the "virtual tablet keyboard", however I would like to do it using the InputPane class. Can someone provide me with a example code just to get me started?
Code to open it without using the InputPane class:
System.Diagnostics.Process.Start("TabTip.exe");
To open the On-Screen KeyboardGo to Start , then select Settings > Ease of Access > Keyboard, and turn on the toggle under Use the On-Screen Keyboard. A keyboard that can be used to move around the screen and enter text will appear on the screen. The keyboard will remain on the screen until you close it.
Right-click the Start button and select Settings. Go to Ease of Access > Keyboard. Turn on the toggle below Use the On-Screen Keyboard.
Click the icon to see the Ease of Access menu, which includes several options to assist users with disabilities. The option we're looking for is On-Screen Keyboard. Click or tap it and you'll see a full-size virtual replica of a standard keyboard layout appear on the screen.
Open the keyboardAt the bottom right, select the time. Accessibility. Under "Keyboard and text input," turn on On-screen keyboard.
One thing. InputPane, you cannot use in WinForms, InputPane is a element of UWP.
I ran this code... And Works!
string progFiles = @"C:\Program Files\Common Files\Microsoft Shared\ink";
string keyboardPath = Path.Combine(progFiles, "TabTip.exe");
Process.Start(keyboardPath);
But I had to add a key (MANUALLY) value on my regedit on HKEY_CURRENT_USER\SOFTWARE\Microsoft\TabletTip
inside the key is a folder named 1.7 (this would change in the future by Microsoft) and add a 32 bit DWORD value named EnableDesktopModeAutoInvoke
with value 1
. This means TRUE. It should look like this:
You can add the key programatically I think you need Admin privilegies. I tried add the key programatically but does not work, It double the entry without any effect (BE CAREFUL);
ADVICES:
Consider, do a process stopper for each process you create. I suposse that you will use this when textbox (ar any input method) request focus. be sure stop the process when component loses his focus.
hope this help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With