Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to force win10 to open virtual tablet keyboard?

Tags:

c#

windows-10

I have an app that needs a virtual keyboard. But, when I click some of my TextBoxes, 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 TextBoxes 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");
like image 300
meme Avatar asked May 16 '16 08:05

meme


People also ask

How do I pop the virtual keyboard in Windows 10?

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.

Why won't my virtual keyboard appear?

Right-click the Start button and select Settings. Go to Ease of Access > Keyboard. Turn on the toggle below Use the On-Screen Keyboard.

How do I open the virtual keyboard when it is locked?

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.

How do I bring up the virtual keyboard?

Open the keyboardAt the bottom right, select the time. Accessibility. Under "Keyboard and text input," turn on On-screen keyboard.


1 Answers

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:

REGEDIT

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.

enter image description here

like image 108
Allan Ramirez Avatar answered Sep 20 '22 12:09

Allan Ramirez