Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!tut.cis.ohio-state.edu!ucbvax!bloom-beacon!eru!hagbard!sunic!news.funet.fi!hydra!cc.helsinki.fi!jmalahtinen From: jmalahtinen@cc.helsinki.fi Newsgroups: comp.os.msdos.programmer Subject: Re: Reading MS Serial Mouse Directly. How? Message-ID: <1991Feb2.232807.4751@cc.helsinki.fi> Date: 2 Feb 91 23:28:07 GMT References: <11609@ucrmath.ucr.edu> Followup-To: comp.os.msdos.programmer Organization: University of Helsinki Lines: 47 In article <11609@ucrmath.ucr.edu>, lulu@ucrmath.ucr.edu (david lu) writes: > Here at UCR we are in the process of revamping a CS hardware > class. One of the labs that we thought would be fun to do is > to have the students write an assembly program that reads the > mouse directly from the serial port, bypassing the device > drivers. So ... does anyone know Microsoft's encoding scheme > for their serial mouse? This information is not in the docs. > > Also, what are the parameters of the serial port? Baud rate? > Stop bits? Parity bits? If someone can at least provide the > parameters, I suppose that I can write some code to read from > the port, and try to figure out the return codes myself. But > if anyone already has that information already available, I'd > be _very_ grateful if you could let me know. > > I guess that I can always try looking at MS's device drivers > with DEBUG, but I'd rather not do that ... :-) > > Thank you for any help you can provide. > > ---==lulu@ucrmath==--- just another bewildered college student. > David T Lu, Amateur Thinker: lulu@ucrmath.ucr.edu, {ucsd, uci}!ucrmath!lulu > "I seem to be having tremendous difficulty with my lifestyle." > - Arthur Dent, Hitchhiker's Microsoft format : bit number 7 6 5 4 3 2 1 0 byte 1 1 1 L R Y7 Y6 X7 X6 byte 2 0 0 X5 X4 X3 X2 X1 X0 byte 3 0 0 Y5 Y4 Y3 Y2 Y1 Y0 Where L for left key status 1 for pressed. X0-X7 is X-axis movement data. R for right key status 0 for released. Y0-Y7 is Y-axis movement data. Data is shifted from byte 1 bit 0 to byte 3 bit 7 at speed of 1200 bps, no parity, 2 stop bits. Data is reported upon key status change and X, Y data change. No change will not cause report. Source : MIGHTY MOUSE user's manual. Jussi Lahtinen E-mail jmalahtinen@cc.Helsinki.FI (Internet) JMALAHTI@FINUH.BITNET (EARN/BITNET) jmalahti@cs.Helsinki.FI (in UNIX word) HYLK::JMALAHTINEN (DECNET)