I am developing an on-screen numpad for a WPF touch app. This will appear in a Popup
. When a button is pressed, it should send a keystroke to the application, making it look as though the user was typing into a TextBox
. This is my code:
// 'key' is set beforehand
InputManager.Current.ProcessInput(new KeyEventArgs(Keyboard.PrimaryDevice, Keyboard.PrimaryDevice.ActiveSource, Environment.TickCount, key) { RoutedEvent = Control.KeyDownEvent });
This is called within the Button.Click
event handler.
So far only Key.Back
has worked. None of the digit keys work, and neither does Key.Decimal
.
EDIT: I thought using SendKeys
would solve the problem, but it just does the same thing.
Why aren't my digit buttons working? I have verified that the correct Key
is being passed.