Hi Sresht,
MOUSE_INPUT_DATA maps (xmin,xmax,ymin,ymax) to screen resolution for ex,
(0,1024,0,768). Your touch screen Controller might give you (x1,x2,y1,y2).
All you have to do is map your touch screen co-ordinates to
(xmin,xmax,ymin,ymax) said above.
I dont remember the exact details but I do remember that I took help from
Doron regarding how Raw Input Thread(RIT) issues READ Irps to mouclass.
When you report of the presence of one more mouse-like device to
mouclass.sys, it sends you an INTERNAL_DEVICE_IO_CONTROL, which contains a
callback, which you need to be called when you have new touch/release
co-ordinates. Upon your call to the mouclass callback, mouclass.sys finishes
off existing READ Irp and RIT sends a new one.
That should give you enough details.
I think Doron is not checking his ntdev mails ![:slight_smile: :slight_smile:](/images/emoji/twitter/slight_smile.png?v=12)
-Giri
On 10/12/06, Shreshth Luthra wrote:
>
> Hi Giri,
>
> First of all tell me one thing, is it OK to create MOUSE_INPUT_DATA
> packets of our own.
> Because the input my PC is going to get are the packets in the form,
>
> X-co-ordinate,Y-co-ordinate, F
>
> Here F is the flag signifying whether it has been depressed or released.
> I need to emulate it to the form of Mouse Left Click and Double Click.
>
> Also it would be helpful if you can provide some link which speaks more
> about it or some similar example.
>
> Thanks and Regards,
> Shreshth
>
> On 10/12/06, giri wrote:
> >
> > 1) Incase you receive multiple touch or release information from the
> > Controller, you should be able to consider only one or average of the
> > positions in those. Otherwise you might be generating multiple double-clicks
> > for a single user touch.
> > 2) You will have to support callibration which SENSES the user intended
> > co-ordinates and not the actual co-ordinates. For ex, u can ask the user to
> > touch at 4 given co-ordinates on the screen, see how the difference varies
> > between the intended point and ‘user touched point’(what he thinks the
> > actual co-ordinates are!)
> > 3) Regarding mapping the co-ordinates on to the screen co-ordinates,
> > MOUSE_INPUT_DATA comes handy
> > 4) When it comes to writing a driver , you will have to write a driver
> > which can talk to serial driver by opening appropriate device object
> > corresponding to the COM port and send read/write requests, set baud rate
> > etc.
> > 5) You have to layer your driver below mouclass.sys. RIT (Raw Input
> > Thread) talks to mouclass.sys to get the mouse-click actions.
> >
> > -Giri.
> >
> > On 10/12/06, Ray Trent < xxxxx@synaptics.spamblock.com> wrote:
> >
> > > Hmmm. Still not entirely sure I understand this setup, but it sounds
> > > like the touchscreen is not actually a display on the computer your
> > > driver would be running on, but it merely a display being controlled
> > > by
> > > some other system/controller/computer/something.
> > >
> > > In that case, it doesn’t make sense for your driver to be a mouse
> > > driver, because those control the cursor on displays being controlled
> > > by
> > > the host running the driver.
> > >
> > > In fact, it doesn’t sound to me like you need a driver at all. A
> > > user-mode service would be quite adequate. If it’s a captured vertical
> > > application system like a kiosk or something, you might even be able
> > > to
> > > get away with a user-mode app running normally on the system.
> > >
> > > All you have to do is open the COM port, read from it and write to it,
> > > right? No driver is needed to do those things. You only need a driver
> > > to
> > > move the real Windows pointer on a real Windows display.
> > >
> > > Shreshth Luthra wrote:
> > > > Hi Ray,
> > > >
> > > > First of all thanks for your reply.
> > > > I think, i having rather confused the things.
> > > >
> > > > See, even i am not having full information. It is just based on the
> > > > things avaiable with me.
> > > >
> > > > Take an example of an Third Party Interface ‘TPI’ which is
> > > understanding
> > > > the Touch Panel’s Voltage signals.
> > > > On one side of TPI is a MicroController having 3 parts:
> > > > 1) a Touch Panel (1024 x 1024). You can assume a sort of Finger
> > > Mouse.
> > > > 2) a LCD Display (800 X480)
> > > > 3) and ofcourse the core Microcontroller which is displaying the
> > > things
> > > > onto the Display Screen (as per the clicks on Touch Panel)
> > > >
> > > > Now suppose the we clicked on the co-ordinate (10,20) of our Touch
> > > > Panel. The signal of Left Click would be sent to the Third Party
> > > > Interface TPI (along with co-ordinates) which will then communicate
> > > with
> > > > COM port of PC and further with our MiniPort Driver.
> > > >
> > > > The MniPort Driver will in turn, map the co-ordinates as per the
> > > > resolution of LCD Display and after doing calibrations, will send
> > > the
> > > > signal back to the TPI, which in turn will be provided it to the the
> > > > MicroController.
> > > > The MicroController will then show that Mouse Pointer on the LCD
> > > Display
> > > > at the co-ordinates corresponding to (10,20) of 1024x1024.
> > > > e.g. X= 10/1024 x 800
> > > > Y = 20/1024 x 480
> > > >
> > > > The only signals the TPI is going to recieve from MicroController
> > > are
> > > > Single Click, Double Click and Drag (all of them along with the
> > > > co-ordinates)
> > > >
> > > > I hope things will be better clear to you now.
> > > >
> > > > Now i want to know what all will be there in the Scope of TouchPanel
> > > > MiniPort Driver, responsiblew for emulation and Calibrations.
> > > > And how to go about it (e.g. start with a Mouse Class Driver)
> > > >
> > > > Also i would like to tell that the Mouse Class Driver above our
> > > > TouchPanel MiniPort Driver already exists.
> > > >
> > > > Thanks alot.
> > > >
> > > > Regards,
> > > > Shreshth
> > > >
> > > >
> > > >
> > > > On 10/12/06, Ray Trent < xxxxx@synaptics.spamblock.com
> > > > <mailto: xxxxx>> wrote:
> > > >
> > > > This sounds like a very confused design.
> > > >
> > > > Let me see if I understand:
> > > >
> > > > The main machine is running XP. It wants to receive input from a
> > >
> > > > TouchScreen. It wants to control its own cursor (i.e. the
> > > TouchScreen is
> > > > the primary screen connected to the host) and it wants to
> > > control it in
> > > > an absolute position sense.
> > > >
> > > > If that’s all the case, then yes, you need a mouse driver. It
> > > don’t
> > > > know
> > > > that I would call it a mini-port driver, exactly, because it’s
> > > just a
> > > > serial mouse driver. Look at the WDK’s sermouse sample for
> > > examples of
> > > > using the com port from the kernel. In terms of mapping the
> > > absolute
> > > > position, you just need to make your calculations (be careful
> > > about
> > > > using floating point) and report the position using the MOUCLASS
> > >
> > > > interface that’s documented (passing in the flag that says its
> > > an
> > > > absolute coordinate). The OS and display driver should take care
> > > of
> > > > putting the cursor on the display.
> > > >
> > > > I’ll also point out that in a lot of situations, you don’t even
> > > need to
> > > > write a driver to do this. If your environment is one where you
> > > can have
> > > > a user-mode application running, it can just open the COM port,
> > > do it’s
> > > > calculations (with no worries about floating point and full math
> > >
> > > > libraries), and then call SendInput to control the cursor.
> > > >
> > > > If, on the other hand, you’re trying to do something weird like
> > > having 2
> > > > cursors on 2 different screens, or you’re trying to operating
> > > another
> > > > computer’s monitor’s cursor or something, very different
> > > solutions will
> > > > be needed (and the 2 cursor solution will probably be impossible
> > > in the
> > > > general case, but that’s another story). Please clarify.
> > > >
> > > > Shreshth Luthra wrote:
> > > > > Hi All,
> > > > >
> > > > >
> > > > > One of our client has asked us to think on a miniport driver
> > > for
> > > > a touch
> > > > > screen which is going to reside between the Mouse Class
> > > Driver
> > > > and the
> > > > > COM Port Driver on the WinXP Professional Machine.
> > > > > COM port of PC is connected via a RS232 interface to a third
> > > party
> > > > > interface which on the other side is having a Microcontroller
> > > or
> > > > Win XP
> > > > > Embedded(Touch Panel + SVGA Touch Screen + Microcontroller).
> > > > >
> > > > > As per the diagram, which is the only input i am having at
> > > > present, it
> > > > > works like this.
> > > > > Whenever there is a click or activity on the Touch Panel, the
> > > third
> > > > > Party interface picks up the the signal ( mouse depressed or
> > > > released )
> > > > > and send it to the WinXP machine which after doing some
> > > > calibrations and
> > > > > mappings as per the Resolution of the Touch Screen sends this
> > > signal
> > > > > back to the third party which then affects the output on the
> > > > Screen and
> > > > > thus the microcontroller.
> > > > >
> > > > > Conceptually the thing look fine, but i am having a few
> > > doubts
> > > > related
> > > > > to it.
> > > > >
> > > > > As per my understanding, the Touch Screen Miniport driver
> > > that we
> > > > are
> > > > > going to write is itself going to be a Mouse Driver, then
> > > what is the
> > > > > role of Mouse Driver on the other side (which he is saying
> > > that is
> > > > > needed for emulation of co-ordinates of Touch Panel).
> > > > > If not a Mouse type driver what is the Miniport driver going
> > > to be.
> > > > >
> > > > > For a Touch Screen Miniport driver is there a standard set of
> > > signals
> > > > > (packets) that the Third Party Interface is going to
> > > send/recieve
> > > > > to/from COM Port Driver or it could be anything (Because this
> > > > needs to
> > > > > be interpreted by the Miniport Driver that we may be
> > > writing).
> > > > >
> > > > > Except for communication with COM Port, calibraion and
> > > emulation, is
> > > > > there anything else that my Miniport Driver might have to
> > > take
> > > > care of.
> > > > >
> > > > >
> > > > > Thanks for your reply.
> > > > >
> > > > > Thanks and Regards,
> > > > > Shreshth
> > > >
> > > > –
> > > > Ray
> > > > (If you want to reply to me off list, please remove “spamblock.”
> > > from my
> > > > email address)
> > > >
> > > > —
> > > > Questions? First check the Kernel Driver FAQ at
> > > > http://www.osronline.com/article.cfm?id=256
> > > >
> > > > To unsubscribe, visit the List Server section of OSR Online at
> > > > http://www.osronline.com/page.cfm?name=ListServer
> > > >
> > > >
> > >
> > > –
> > > Ray
> > > (If you want to reply to me off list, please remove “spamblock.” from
> > > my
> > > email address)
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=256
> > >
> > > To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
> > >
> > >
> >
> > — Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the
> > List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
> >
>
>
> — Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List
> Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer</mailto:>