[comp.sys.amiga] Hacking Up A Mouse

ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) (05/20/87)

[ If the net frowns on long signatures, what about these? ]

	People have been hacking trakballs to work with the Amiga, which
prompted me to write this article.

	Recently, I was in San Jose, CA, and purchased a mouse in a surplus
store.  I had seen the same kind of mouse in use with other machines
(notably, the IRIS), and thought it would be kinda neat to convert this
thing to work with my Amiga.  I just succeeded in this operation, and
thought that those of you who want to "add an extra button" to your mouse
might be interested.

DESCRIPTION:

	The mouse in question is, according to the sticker on the back, "The
HAWLEY X063X Mouse, MARK II," apparently manufactured by The Mouse House in
Berkeley, CA.

	The mouse generates TTL quadrature signals, and has three active-low
TTL buttons.  The rotation sensors are brush-type.  One brush provides a
signal (type unknown), the remaining four pick up the signal off a form of
commutator and feed it into a simple set-reset flip-flop network.  The
physical arrangement of the brushes over the commutator creates the phase
difference which allows generation of quadrature signals.  The buttons are
clicky, tactile feedback-type.

	The base of the mouse is solid metal, with a steel motion detection
ball (hence, low friction; go find your mouse pad), and two more rolling
steel balls to cut down on roll resistance.

	Overall, it has a nice feel to it.  Opening the mouse revealed a
very solid design.  The buttons even generate true TTL levels for both
states; no floating highs on this baby.

RECONSTRUCTION:

	There are a couple of approaches.  The first is to find yourself a
Swedish Connector (my personal term for "Gender Bender"), since the mouse
comes with a male DB-9.  The other is to cut all the wires and reconnect
with a female DB-9.  In either case, you're going to have to move pins
around.  I chose to replace the male DB-9 with a female.

	The first thing I did was run an oscilloscope on the mouse to find
out what all the pins did.  This done, I proceeded the wire in the DB-9
female.

	The DB-9 male that comes with the mouse is the type with removeable
pins (not Molex, but similar).  I recommend that you replace it with a
female of similar type, so that you can move pins around if you goof.  Using
the special tool you need for these things, I pulled all the pins out of the
connector and cut them off.  (You might make special note of the fact that
the ground pin has *TWO* wires coming out of it, BLACK and BROWN.)

	Yes, I suppose you could cut the wires without removing the pins,
but the way I did it left me with a fraction of an inch more wire to play
with.  This is important if you're as clumsy with a wire stripper as I am.

	Next, I stripped about 1/16" of insulation off the wire ends.  Be
careful when doing this, since the wire is very fine.

	Then I soldered the removeable female pins I bought onto the ends of
the wires, making sure that BLACK and BROWN went to the same pin.  You
should have nine pins when you're done.

	At this point you should be ready to shove the pins into the
connector with your special tool.  Here's the wiring:

1	Vert		ORANGE
2	Horiz		VIOLET			Connector pattern (looking
3	Vert Quad	RED			at the back of *your*
4	Horiz Quad	BLUE			connector):
5	Middle Button	GREY
6	Left Button	WHITE			 1   2   3   4   5
7	+5V		GREEN			   6   7   8   9
8	GND		BLACK/BROWN pair
9	Right Button	YELLOW

	(Interesting side story:  The female connector I bought was mis-
marked.  If you looked at the front, the pin positions were labelled, right
to left, 1-2-3-4-5.  If you then turned it around and looked at the back,
you'd find the pins numbered, right to left, 1-2-3-4-5.  Think about it.)

	At this point, you should be done.  Plug the mouse into the Amiga
and move it around.  If the pointer moves, you're in business.  Click the
left and right buttons to check their operation.  The leftmost button on the
mouse is the selection button.  The rightmost button is the menu button.
The middle button is connected to the system (as button #3, according to
the Hardware manual), but Intuition currently doesn't know what to do with
it, so it's useless without special software.

	If you press the middle button, that should generate an
IECODE_MBUTTON event.  I haven't tested this to make sure, but it seems
reasonable.  You can use the following defines in any code you write to make
use of the middle button.

#define	MIDDLEUP	(IECODE_MBUTTON | IECODE_UP_PREFIX)
#define	MIDDLEDOWN	(IECODE_MBUTTON)

	Anyway, if you decide to go for this exercise, remember that there
are no warranties express or implied regarding whether the above procedure
will work for you, nor are there any guarantees that The Mouse House won't
change the color of their wires on everyone.

	Hope this serves some sort of purpose.  I had fun.  I haven't
hardware hacked in a long time...

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Leo L. Schwab -- The Guy in The Cape	ihnp4!ptsfa -\
 \_ -_	 Bike shrunk by popular demand,	      dual ---> !{well,unicom}!ewhac
O----^o	 But it's still the only way to fly.  hplabs / (pronounced "AE-wack")
"Work FOR?  I don't work FOR anybody!  I'm just having fun."  -- The Doctor