Ideas on how to implement virtual keyboard

Feb 24, 2009 at 11:30 AM

I'd appreciate some ideas on how to implement virtual keyboard.
First, I thought to create RawKeyboardInputReport and send it in the InputManager (like HwndKeyboardInputProvider do), the problem is that most classes are internal.
Then I thought : what about sending raw message to windows ?  I used ManagedWinapi and have done a simple application to see if I was able to write in a textbox when I click on a button.
The problem which seems trivial at first is that the keyboard should focus the textbox, then I call myTextBox.Focus().
Then, I saw I can't focus... why ? I thought it was a bug of Multitouch Vista, but in reality the problem is far more important !
Most built-in control work with the notion of Focus, one or zero element at any given moment should have the focus of the keyboard.
The notion of focus is obsolete in multi touch world, because we can have multiple focus at the same time (two person around a table should be able to write inside a textbox).
Then I know that WPF textbox are not windows textbox unlike winform, then maybe some of you have a solution about how to change  any keyboard or focus centered controls behavior without reimplementing them from scratch, and taking advantage of the already built keyboard infrastructure of WPF (routed events, KeyboardDevice, Keyboard, shortcuts etc...).

What do you think ?