I would like to create an event in a button.
When I click in the button, I would like to open the Windows virtual keyboard.
Can you help me with the code?
Thank you for your collaboration.
Best regards.
I would like to create an event in a button.
When I click in the button, I would like to open the Windows virtual keyboard.
Can you help me with the code?
Thank you for your collaboration.
Best regards.
I think it would be as simple as this:
Runtime.getRuntime().exec("osk");
You can use getRuntime to execute it:
import java.io.IOException;
public class ShowVirtualKeyboard{
public static void main(String argv[]) throws IOException {
String sysroot = System.getenv("SystemRoot");
Process proc = Runtime.getRuntime().exec(sysroot + "/system32/osk.exe");
}
}
and you can call proc.destroy()
to get rid of it.
Regards.
This will work: Runtime.getRuntime().exec("cmd /c osk");
cmd /c
will launch the process and invoke the UAC if needed.
Advantage:
Disadvantage: