Calling the on-screen keyboard using a button in C#
Asked Answered
S

3

22

I am creating a windows application using C#, where in a button on the GUI when clicked, should display the on-screen keyboard.

Would appreciate if any help is granted. thanks.

Also, since I am mostly using Emgu Cv library for the rest of my app, Can we simply use it for calling the On-screen keyboard?

Sellingplater answered 10/1, 2012 at 8:7 Comment(2)
Process.Start("osk.exe"); should work on all Windows systems.Uranometry
@CodyGray unfortunately not working when building for x86 (I am forced due to GeckoFx)Rifling
G
35

In C#, you can simply write the following line of code to invoke the on-screen keyboard application that comes with Windows:

System.Diagnostics.Process.Start("osk.exe");

You can find more help here.

Garvey answered 10/1, 2012 at 8:29 Comment(3)
I just tried it in win10 (creators update) and it worksAlek
On Windows 10 you need to change Build settings to perform target in x64 like @Hassan Rahman saidRadcliffe
The solution in this link worked for me: #2929755Mammiemammiferous
L
14

For Windows 10 x64, You have set the project build to x64 as shown in image.

enter image description here

Process process = Process.Start(new ProcessStartInfo(
            ((Environment.GetFolderPath(Environment.SpecialFolder.System) + @"\osk.exe"))));
Ladle answered 5/10, 2017 at 14:58 Comment(0)
B
0

I had some problems trying to run osk within and endpoint. This works for me:

var onScreenKeyboardProcess = new ProcessStartInfo("osk.exe")
{                    
    UseShellExecute = true
};
Process.Start(onScreenKeyboardProcess);
Biscuit answered 20/10, 2023 at 6:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.