Consider an application scenario, you have designed a multifunctional LCD display device, assuming that in order to save costs, there is no touch screen and extended mouse keyboard interface, only a few external buttons on the instrument, but because the function is relatively complex, need to configure a lot of parameters, if rely on only external button, input not only slow, You have to design a set of input rules for this, think about it. If you can pass the instrument debugging port, through the extension lets our PC become its mouse keyboard, then the input work will change unusually simple (actually this kind of meter is not I am blind to think, before developing the ICU infusion system, the foreign production infusion device is this kind of instrument, for example To enter the name of the drug, infusion speed and infusion pressure, such as a series of related parameters.
By extending the WinForm library I previously developed for. NET MF (see my previous article, "Open source System.Windows.Forms library, make the. Net Micro Framework interface as simple as the host computer"), add an input agent layer, You can implement virtual mouse and keyboard input.
Take a look at the final results (pictured below), and then we'll go into the details of how it is achieved.
(Virtual mouse input, the mouse on the device will be synchronized with the mouse on the PC)
(virtual keyboard input, do not think that the above characters for the soft keyboard input, attentive readers will find that the soft keyboard there is no @#¥%, etc.)
It's not that simple to implement you need to do the following four steps: First, to develop a plug-in for Mfdeploy, to capture the PC mouse and key information, and send them to the device; second, modify the TINYCLR kernel code, so that it gets the PC to send the mouse and key information; MF Adds an event source that triggers a specific event in a. Net MF Application When there is a mouse and a key, and extends an input agent layer for the WinForm library. Here's a step-by-step description of the implementation steps for the four steps above.