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