Click here to Skip to main content
15,887,988 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi,

Is there any way to invoke an on-screen keyboard in win7? Something like touch input, the virtual keyboard will be visible as demand. Applicable for whole win7 instead of specific application.

Thanks
Posted
Updated 28-Apr-11 1:29am
v2

You can start On-screen keyboard via Process.Start("osk"); - Start -> Run -> "osk"

And and perhaps use some WM_XX message to show and hide?
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 28-Apr-11 13:17pm    
It works, my 5.
For some advanced things, please see my answer and references.
--SA
Pdaus 28-Apr-11 22:17pm    
yup, u r correct..but the problem is how system know when to hide or show? coz i want it to be automated. Something like a notification in order to use the WM_XX message to show and hide.
Kim Togo 29-Apr-11 3:15am    
Okay, I think I get your point. You what to:

1. If focus is in a TextBox/ComboBox/Something that what text input, then virtual keyboard have to show.
2. When focus leaves, then virtual keyboard have to hide.
3. All automated.
Pdaus 29-Apr-11 3:38am    
yup..exactly...how do check for related WM_xx. Once again for system wide. Not for specific application only
Kim Togo 2-May-11 7:32am    
Sorry Pdaus. I cannot answer this. I have never had the need to do anything like this.
What Kim says is the right way.

However, if you really need to use touch input, it can be not suitable. Usually, touch input requires larger controls, for example, and the interests of the users using touch are largely ignored by design of Windows including the latest versions. If this is the problem, you may want to create your custom Virtual Keyboard.

It should be system-wide as well, of course.
You can find the key recipe on how to do it; please see my past answers and this discussions:
Application focus getting and losing[^],
Programming on BACKSPACE button[^].

See also this CodeProject article:
A software Virtual Keyboard for your WPF apps[^].

—SA
 
Share this answer
 
v2
Comments
Pdaus 28-Apr-11 22:53pm    
I get your point, but actually I want some mechanisme that tell my custom virtual keyboard to be visible when it focus the element which is waiting for keyboard input. For this purpose, my custom virtual keyboard will be considered as system-wide usage. Any hint or guidance?
Sergey Alexandrovich Kryukov 29-Apr-11 2:32am    
Great, you're doing it right, looks like.
As to advices -- those I provide in my references are fully applicable.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900