Searching \ for '[PIC]: Simulating clicks of a mouse' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'Simulating clicks of a mouse'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Simulating clicks of a mouse'
2001\05\17@085057 by Matthieu Baraban

flavicon
face
Hello all,

I would like to build an interface between a mouse and a PC, using a
PIC16F84, that could "simulate" clicks of the mouse (for an handicapped
person)
My goal is to have a box with 2 big buttons, between the mouse and the PC.
----         ---------
| PC |       | Buttons |           -------
|    |-------| O    O  |----------- Mouse |
|    |       |         |           -------
----         ---------

The bus used is the PS/2 bus.
I would like to know if code (or part of code) exists.
The problem for me is that I have to get the previous flow from the mouse (8
bits -> Y,X,Y sign,X sign,1,Middle Button,Right Button,Left Button) and then
set a button bit, and resend the command.
And, another thing, is that I do not want to hack a mouse for removing its
buttons.
Do anyone have link, ideas, tips etc ?
Thanks a lot,
Best regards,

Matthieu.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\05\17@090344 by Jinx

face picon face
> I would like to build an interface between a mouse and a PC, using
> a PIC16F84, that could "simulate" clicks of the mouse (for an handi-
> capped person) My goal is to have a box with 2 big buttons, between
> the mouse and the PC.

Does this help ? It's MS though, not PS/2

http://home.clear.net.nz/pages/joecolquitt/0emouse.html

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\05\17@091033 by Dale Botkin

flavicon
face
On Fri, 18 May 2001, Jinx wrote:

> > I would like to build an interface between a mouse and a PC, using
> > a PIC16F84, that could "simulate" clicks of the mouse (for an handi-
> > capped person) My goal is to have a box with 2 big buttons, between
> > the mouse and the PC.
>
> Does this help ? It's MS though, not PS/2

I don't think there is a difference, other than the connector, port and
IRQ used.  You can get DB9 <--> mini-DIN adapters and use either one on
either type of port.

Dale
--
A train stops at a train station.  A bus stops at a bus station.
On my desk I have a workstation...

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\05\17@091143 by Matthieu Baraban

flavicon
face
Thanx Jinx,

This what I already saw on the internet.
But I don't know if I move the real mouse, then simulate a click (with
unknown positions ?) this could work.
I'm investigating it.
Thanks again,

Matthieu.

{Original Message removed}

2001\05\17@091824 by Dale Botkin

flavicon
face
Why not modify the mouse, solder wires to the button switches and add an
external box with big buttons?

On Thu, 17 May 2001, Matthieu Baraban wrote:

> Thanx Jinx,
>
> This what I already saw on the internet.
> But I don't know if I move the real mouse, then simulate a click (with
> unknown positions ?) this could work.
> I'm investigating it.
> Thanks again,
>
> Matthieu.
>
> {Original Message removed}

2001\05\17@092458 by Bob Ammerman

picon face
This would be _much_ easier with a serial mouse than PS2.

A serial mouse just generates a continuous stream of 3 byte reports.

I have built a device, which I called the NOMOUSE. It simply generated a
continuous stream of mouse position reports in the form:

do forever:
   X+8, Y+8
   Y-8,  Y-8
end do

This device was then hooked to the serial mouse port of a KVM
(keyboard-video-mouse) switch.

Thus, the 8 computers that were connected to the KVM switch could tell when
the KVM was 'watching' them because they would see the mouse action. When
the KVM was not watching them they would see no mouse activity.

If you want to try this with a serial mouse protocol instead of PS2 I'd be
glad to help. You could email me off list.

Bob Ammerman
RAm Systems
(contract development of high performance, high function, low-level
software)


{Original Message removed}

2001\05\17@092509 by Bob Ammerman

picon face
A PS/2 mouse uses TTL levels and a clocked synchronous protocol.

This is _nothing_ like the RS232 protocol used by a serial MS mouse.

Bob Ammerman
RAm Systems
(contract development of high performance, high function, low-level
software)

{Original Message removed}

2001\05\17@093956 by Dale Botkin

flavicon
face
On Thu, 17 May 2001, Matthieu Baraban wrote:

> Thanx Jinx,
>
> This what I already saw on the internet.
> But I don't know if I move the real mouse, then simulate a click (with
> unknown positions ?) this could work.
> I'm investigating it.
> Thanks again,
>
> Matthieu.
http://panda.cs.ndsu.nodak.edu/~achapwes/PICmicro/mouse/mouse.html

<quote>
If I then press the Left Button...
Mouse: 09 1 1 00001001; bit0 = Left button state; bit3 = always 1
Mouse: 00 1 1 No X-movement
Mouse: 00 1 1 No Y-movement
... and release the Left Button:
Mouse: 08 0 1 00001000 bit0 = Left button state; bit3 = always 1
Mouse: 00 1 1 No X-movement
Mouse: 00 1 1 No Y-movement
</quote>

Looks like you can send a click with no movement.  Those two bytes are
movement counters, not position indicators.

Sheesh, I've learned more about PS/2 mice in the last 30 minutes than in
the last 10 years...

Dale
--
A train stops at a train station.  A bus stops at a bus station.
On my desk I have a workstation...

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\05\17@094757 by Michael Rigby-Jones

flavicon
face
So how come *some* PS2 mice will work on a serial port using a simple
passive adapter cable?  Does these mice provide both protocols on different
pins of the PS2 plug?

Regards

Mike

> {Original Message removed}

2001\05\17@094804 by Jinx

face picon face
> This what I already saw on the internet.

I wasn't entirely sure what you meant and I haven't hacked
a PS/2 mouse yet. If you know what the data stream is
you should have no trouble detecting the button bit, as any
old computer slower than a PIC can do

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\05\17@102453 by Dale Botkin

flavicon
face
On Thu, 17 May 2001, Dale Botkin wrote:

> On Fri, 18 May 2001, Jinx wrote:
>
> > > I would like to build an interface between a mouse and a PC, using
> > > a PIC16F84, that could "simulate" clicks of the mouse (for an handi-
> > > capped person) My goal is to have a box with 2 big buttons, between
> > > the mouse and the PC.
> >
> > Does this help ? It's MS though, not PS/2
>
> I don't think there is a difference, other than the connector, port and
> IRQ used.  You can get DB9 <--> mini-DIN adapters and use either one on
> either type of port.

Never mind, I was wrong.  Apparently some (most??) mice can auto-detect
and adapt to either environment, about five minutes of searching shows the
PS/2 interface is not the same.  Guess that will teach me to try to be
helpful before my second cup of coffee.

Dale
--
A train stops at a train station.  A bus stops at a bus station.
On my desk I have a workstation...

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\05\17@103850 by Dale Botkin

flavicon
face
On Thu, 17 May 2001, Michael Rigby-Jones wrote:

> So how come *some* PS2 mice will work on a serial port using a simple
> passive adapter cable?  Does these mice provide both protocols on different
> pins of the PS2 plug?

I suspect the same pins are used, but the controller detects if there is a
keyboard-style reset going on and uses the PS/2 keyboard-style interface
protocol if so.  If not, send inverted bit-banged serial data for serial
protocol.  Anyway, that's how I would do it if I were designing a mouse.

Of course all PICLIST subscribers know by now that using TTL or CMOS
levels to communicate with a PC serial port is a flagrant violation of the
RS-232C interface specification, and is completely unsuitable for any sort
of commercial use, so I'm terribly glad I don't have to design mice for a
living.  <grin>

Dale
--
A train stops at a train station.  A bus stops at a bus station.
On my desk I have a workstation...

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\05\17@182649 by Alexandre Domingos F. Souza

flavicon
face
>I don't think there is a difference, other than the connector, port and
>IRQ used.  You can get DB9 <--> mini-DIN adapters and use either one on
>either type of port.

       Not always!!! The PS/2 protocol for mouse is completely different from the serial one. Some mice (as the microsoft and logitech ones) are "dual port capable" - if you connect to a serial port OR a ps/2 port, it will auto-configure and work. But the cheaper mice aren't.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\05\17@195802 by Herbert Graf

flavicon
face
IIRC they auto detect (or can be changed with a switch on the bottom) what
kind of port they are connected too (probably by using voltage levels) and
adjust to match. TTYL


> {Original Message removed}


'[PIC]: Simulating clicks of a mouse'
2001\06\13@153324 by David Cary
flavicon
face
Dear Matthieu Baraban,

[I thought I sent this a long time ago, but apparently this message has been
gathering dust in my out box ...]

I think I agree with Dale Botkin. The quick and easy way to do this is to hack
the mouse, add some wires to the button switches, run the wires to your Big
Buttons. As a bonus, the (small) buttons on the mouse still work normally.

If you go ahead with the PIC solution, what are you going to do when you're in
the middle of sending the "button down" message and a "mouse moved" message
comes in from the mouse ? (I guess it would be harmless to ignore that one
packet ...).

Matthieu Baraban <spam_OUTMatthieu.BarabanTakeThisOuTspamCORP.PALM.COM> on 2001-05-17 07:39:44 AM
asked:
> I would like to build an interface
...
> that could "simulate" clicks of the mouse (for an handicapped
> person)
> My goal is to have a box with 2 big buttons, between the mouse and the PC.
>  ----         ---------
> | PC |       | Buttons |           -------
> |    |-------| O    O  |----------- Mouse |
> |    |       |         |           -------
>  ----         ---------
...
> And, another thing, is that I do not want to hack a mouse for removing its
> buttons.


Dale Botkin <.....daleKILLspamspam@spam@BOTKIN.ORG> on 2001-05-17 08:19:18 AM responded,
> Why not modify the mouse, solder wires to the button switches and add an
> external box with big buttons?

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...