Click here to Skip to main content
15,886,072 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi guys,

I'm developing a kiosk information application using WPF Page with Maximize windows state. On application, it has some page with accessing to certain web page.

Q1: How to open a virtual keyboard when user press on any input (textbox) in webpage? How to detect it? I'm placing a WebBrowser element to my WPF.

Q2: How to disable unwanted key on virtual keyboard (OSK)? I don't want any function F1-F12 and certain key to be use to overcome user to close the application or open task manager..


Right now, opening a web page in my window is OK. But how to Q1 when username input is focus. And Q2.. Appreciate if you guys can help me to provide a link because I don't know a specific word to google for it..
Posted

1 solution

I would suggest one possible approach: show this virtual keyboard not in your WebBrowser control, but in your window showing that control, separately. In this case, the keyboard can be shown just be splitting the window, giving the appropriate room for the keyboard. Another approach would be popping a second WPF window with a keyboard, possibly semi-transparent.

In this case, your second question will be eliminated: you would show your own keyboard with the keys you want to provide on it.

See also my past answer related to WPF virtual keyboard: A software Virtual Keyboard for your WPF apps[^].

[EDIT]

How to send keyboard events then? There is only one method which does not depend on anything like focused state of element: using the Windows API SendInput:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms646310%28v=vs.85%29.aspx[^].

You can use P/Invoke to use it, but this is already done for you here: http://www.pinvoke.net/default.aspx/user32.sendinput[^].

—SA
 
Share this answer
 
v2
Comments
Luiey Ichigo 2-Dec-14 3:20am    
Hi SA,

I already able to open a onscreenkeyboard but it has all function in keyboard. Is there any possibilities to show wanted keychars on it?

On your second approach, that is a better option to give what is needed on my own keyboard. But how to send characters let's say user press into input; how to detect the textbox? And when user press my keyboard, how to send the characters into the webpages input?
Sergey Alexandrovich Kryukov 2-Dec-14 3:28am    
My advice is alternative to what you do. In this approach, you design what you want to show and what not.

As to sending input from the virtual keyboard, please see my update to the answer, after [EDIT].

—SA
Luiey Ichigo 2-Dec-14 3:40am    
Ok.. I will try to do what you suggested and will update later. Thanks

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