locked
Simulate Keyboard Message RRS feed

  • Question

  • Hi,

    I have virtual keyboard and I was wondering how can I simulate KeyDown event for the textbox.

     Should I use RaiseEvent?

    In my MFC virtual keyboard version I was sending message WM_CHAR to the edit box in  my button click handler. What do I have in WPF instead?

    Appreciate any help.

     

     

    Wednesday, February 22, 2006 7:38 PM

Answers

  • If you're just talking about a text box, I would consider something text box-specific like appending character to the end of the text box.  Mind you, that doesn't work so good for anything other than English (for non-English, the mapping between keystrokes and text input characters is non-trivial).

    Another approaches to call Win32's SendInput.  There is no WPF equivalent right now because SendInput by its nature goes across process, which is not something WPF does.

    Thursday, February 23, 2006 3:46 AM

All replies

  • While I don't have a direct answer, my suggestion would be to have a look at the Automation namespace. It allows you to automate (go figure) all kinds of input.

    HTH,
    Drew

    Wednesday, February 22, 2006 9:03 PM
  • If you're just talking about a text box, I would consider something text box-specific like appending character to the end of the text box.  Mind you, that doesn't work so good for anything other than English (for non-English, the mapping between keystrokes and text input characters is non-trivial).

    Another approaches to call Win32's SendInput.  There is no WPF equivalent right now because SendInput by its nature goes across process, which is not something WPF does.

    Thursday, February 23, 2006 3:46 AM
  • Thank you Nick.

    I'll call Win32's  SendInput for keystrokes events synthesizing.

    Irina

     

     

    Thursday, February 23, 2006 2:30 PM