The Cyber-Spy.Com Usenet Archive Feeds Directly
From The Open And Publicly Available Newsgroup
This Group And Thousands Of Others Are Available
On Most IS NNTP News Servers On Port 119.
Cyber-Spy.Com Is NOT Responsible For Any Topic,
Opinions Or Content Posted To This Or Any Other
Newsgroup. This Web Archive Of The Newsgroup And
Posts Are For Informational Purposes Only.
From: "Roger Lascelles"
Subject: Re: using a mouse as an event logger
Date: Fri, 20 Sep 2002 12:22:34 +1000
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
1. The mouse driver uses INT 33h. The calls are listed - I am sure you can
find them documented on the Internet. You can request stuff like relative
movement or absolute position, button status. You can define mouse horiz
and vert range. QB can do INT calls.
2. You can simply open the COMM port from QB and grab the stream of bytes
emitted by the mouse. For a start, run a loop which reads a byte from port
and displays it on the screen. You will soon get a grasp of which movements
produce which bytes sequences. I forget the baud rate, but it will be
documented on the Internet, or you can try common baud rates like 9600, 4800
until your QB test program shows consistent byte values. From memory, no
parity, 1 stop bit should do it.
My preference would be method 1. - the mouse driver is interrupt driven and
can handle 100s of times faster movement than QB could do using method 2.
Also method 1 lets you reset the mouse from QB which will fixes frozen mouse
pointer type problems.
I'm afraid I have no sample code - there is a few hours work involved.
"Jim" wrote in message news:5iki9.394$b_1.361@fe01...
> I have a need for a simple event logger for use under DOS. I need to
> record, in a pair of files, the date and time of each of 2 re-occurring
> events....movement right and movement left.
> I'd like to try and use a hacked PS2 or serial mouse in one of a couple
> ways. The first would be to simply use the microswich circuits (the mouse
> buttons) as the triggers. I.e., when the left button is pressed, the
> computer recognizes that the action has occurred and records the system
> and time of the button press in a disk file, and the same for the act of
> right button event...in a second file of course.
> I think that this should be pretty simple to do using Quickbasic.
> The second way I would like to try is to use the left-right movement of
> mouse (no up/down) and have the Quickbasic program detect the motion and
> determine if it is left or right movement. The amount of movement isn't
> significant-only the direction of movement.
> The reason I'd like to use this method is because I'll be using a sensor
> setup which is the equivelent of the optical encoder wheel and 2
> photo-interrupters in the mouse itself. The recorded results would need
> be the same as before....record date and time of each "left" movement in a
> disk file and each "right" movement in a second file.
> The only thing here is that the encoder is going to have only one large
> or window----50% of the wheel solid and 50% window, so the quadrature
> would be long. Is detection of single quadrature pulses using the mouse
> driver and Quickbasic a problem?
> If someone can help me with a few lines of QB code to do this I would
> appreciate it. I did some searches, but can't find that this type pf
> project has ever been tried before. If anyone would like to give it a try
> to help out the cause, I'll send them a couple of Omron photo-interrupters
> to use. This is the main part of the hardware for this project other than
> an old mouse.
Go Back To The Cyber-Spy.Com
Usenet Web Archive Index Of
The sci.electronics.design Newsgroup