How to bring up the Windows 8 on-screen keyboard in a desktop app
Asked Answered
L

4

7

I have a fullscreen DirectX desktop app, and would like to display the on-screen keyboard when the user taps a textbox in my game. Is there a way to do this while in fullscreen mode?

Land answered 8/8, 2012 at 22:17 Comment(1)
Is there any way to hide the keyboard?Murmurous
I
17

Executing osk.exe will pop up the more old-fashioned on-screen keyboard. The Windows 8 touch keyboard will pop up by executing

C:\Program Files\Common Files\Microsoft Shared\ink\TabTip.exe

I just figured that out, since I'm working on a fullscreen desktop app that is running on a tablet PC without keyboard attached.

Severin.

Infra answered 24/8, 2012 at 12:55 Comment(2)
Was looking for a better way of doing it, but this seems to be the only reasonable method that actually works.Land
And how do you hide it?Murmurous
H
3

Same answer as Severin Stampler but in order to find the correct path from c# I use:

var path = Environment.GetFolderPath(Environment.SpecialFolder.CommonProgramFiles) + @"\Microsoft Shared\ink\TabTip.exe";

if (!File.Exists(path))
{
   // older windows versions
   path = Environment.GetFolderPath(Environment.SpecialFolder.System) + @"\osk.exe";
}
Harp answered 28/5, 2013 at 9:55 Comment(1)
When you're running a 32bit application, TabTip.exe won't be found on a 64bit system. GetFolderPath will give you the "Program Files (x86)" folder, the tabTip.exe in there is called "TabTip32.exe"Fug
R
1

If it is a desktop app, you might need to invoke ShellExecute for osk.exe.

If it is a Metro application, then you cannot invoke the SIP from the app itself. As per the MSDN docs:

This means that applications cannot programmatically invoke the touch keyboard via manipulation of focus. Big culprits here in the past have been webpages—many of them set focus by default in

Ra answered 9/8, 2012 at 3:29 Comment(0)
C
1

You can show the Windows 8 touch keyboard quite easily:

http://brianlagunas.com/showing-windows-8-touch-keyboard-wpf/

Cabasset answered 18/12, 2013 at 3:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.