All Forums
 Microsoft Windows CE
 .NET Application Development
 C# Keypad Thread?
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

mcmalburg

28 Posts

Posted - 18 Feb 2008 :  21:45:04  Show Profile  Email Poster
It seems like this must have been asked somewhere before - but I can't seem to find an answer...


In C# (Visual Studio 2005) is there a way that I can simulate a keyboard from within a worker thread?

I'd like to start a worker thread that continually polls:
SmartIO.ReadKeypad();
and then sends out keyboard messages as if the keypad is a real keyboard.

My hope is that with such a thread running, I can simply open modal dialogs and the keyboard messages will be "magically" sent to the modal dialogs (without having to carry around SmartIO functions) between my main form and the modal child dialogs. Furthermore, this will make my "hardware version" and my "emulator version" much more compatible.

It seems like there was something like this in the old ADS C++ libraries, but I haven't seen it for C# / .NET.

Any ideas?

kurtwl

28 Posts

Posted - 19 Feb 2008 :  03:00:17  Show Profile  Email Poster
keybd_event() may help. Just be carefull translating your key into a virtual-key code. keybd_event certainly does the magic you are looking for.
Go to Top of Page
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.02 seconds. Snitz Forums 2000