How do you target external app that is to receive keystrokes?

Jan 4, 2010 at 2:38 AM

I'd just like to start by saying this is an incredibly well done done application. The commenting is extensive and the apps general organization is impeccable!

My question is, where in the code you target the window where the text will be sent, or in other words, the window / control that will receive the message sent. I have been all through both the Touch Screen Keyboard source and the InputSimulator source but am not able to find where this is done. I was expecting something like FindWindow or something or maybe a setting for the Keyboard to make it not take focus, thus keeping the last application with focus on top but have found nothing. Anyway, any direction you can point me will be greatly appreciated.

 

Once again, great application!!!!!!

 

k.

 

Coordinator
Jan 11, 2010 at 5:33 AM

Hi there,

Thanks for the feedback.  The original intent of this keyboard implementation was to provide input to the same application, not as a replacement for the integrated touch screen keyboard in windows. That being said there may a way to stop the keyboard window from taking focus away from the intended target window, but I'd need to have a look.  Feel free to do so yourself too...  ;)

Mike

Jan 11, 2010 at 11:20 AM

great sample, feel free to investigate commercial touch screen keyboard here http://fpscomponents.com/Product.aspx?id=8

it has more features, as it works as windows embedded one, or can be built in your WPF application. 

also there's layout creator tool for end user to be able to create any kind of layout, along with any language user installed on PC,  also you can use any theme. 

 

Jan 11, 2010 at 7:07 PM
michaelnoonan wrote:

Hi there,

Thanks for the feedback.  The original intent of this keyboard implementation was to provide input to the same application, not as a replacement for the integrated touch screen keyboard in windows. That being said there may a way to stop the keyboard window from taking focus away from the intended target window, but I'd need to have a look.  Feel free to do so yourself too...  ;)

Mike

 Actually, what I meant to say is that your application is already doing what I want it to do, I just can't find where in the code you are doing it. After a few hours of running your code in debug, it seems like you aren't actually targeting the last application, it  is just a nice side effect from the floating popup the keyboard is contained in. Would you say that is accurate?

The behaviour I am observing is the following:

  • Open Notepad and minimize.
  • Open Internet Explorer and minimize.
  • Open WPF Keyboard.
  • WPF Keyboard window opens maximized with the Keyboard floating in a popup window.
  • Test #1
    • Click cursor in the Windows Taskbar search text field.
    • Click variety of keys on WPF Keyboard
    • PASSED (keystrokes appear in textbox)
  • Test #2
    • De-Minimize Notepad. (Notepad appears between WPF Keyboard parent window and floating keyboard)
    • Click variety of keys on WPF Keyboard
    • PASSED (keystrokes appear in Notepad)
  • Test #3
    • De-Minimize Internet Explorer. (Explorer appears between WPF Keyboard parent window and floating keyboard)
    • Click cursor in Explorer's Address Bar
    • Click variety of keys on WPF Keyboard
    • PASSED (keystrokes appear in Explorer's Address Bar)

Question is, how are you doing this? The target app (Notepad, Explorer, etc.) seem to keep focus between clicks of keys on the WPF Keyboard and I am not able to find any code explicitly doing this. If this is just a behavior borne out of the native Popup window, great, if not, any hints to where this is happening in code would be greatly appreciated...

Thanks

k.

P.S. - Any plans on simulating an on screen mouse? Movement and all...

Coordinator
Apr 7, 2010 at 6:35 AM

Hi k.

Sorry I didn't reply.  I lost the email in a pile of others.

Glad to hear everything is working how you'd hope, even if it is by the magic of the popup primitive control in WPF... :)

A few of us are working on adding mouse simulation to the underlying inputsimulator project that is used by the wpfkb project.  This release will also add the ability to use the InputSimulator in Dependency Injection (IoC situations) and provide for a better testing experience.

Kind Regards,
Mike