[gpm][PATCH] handle more mice
Pozsar Balazs
pozsy@uhulinux.hu
Sun, 30 Jun 2002 19:15:32 +0200 (MEST)
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.
---559023410-851401618-1025457332=:2649
Content-Type: TEXT/PLAIN; charset=US-ASCII
Damn it, i forgot to attach :)) The problem is with the user :)
I didn't intend this for cases where people have >2 mice, more simply I
wanted to able to start gpm like this:
gpm -t ps2 -m /dev/misc/psaux -M
-t exps2 -m /dev/input/mice -M
-t pnp -m /dev/tts/0 -M
-t pnp -m /dev/tts/1
Hope you got the point: This way I don't have to know where the user's
mouse is. I _know_ that the above won't work always (this was just a
primitve example). But anyway... why not support more mice when it is so
easy?
On Sun, 30 Jun 2002, Nico Schottelius wrote:
> either my mailer is broken or you forgot to attach a patch again.
>
> why should someone use more than 2 mice ? I've even never used two at a
> time. I think people only have two hands to use them, don't they ?
>
> Nico
>
> Pozsar Balazs [Sun, Jun 16, 2002 at 02:56:34AM +0200]:
> > Hi again!
> >
> > This patch makes gpm handle up to 8 mice. (arbitrary limit, by a #define).
> >
> > The opt_double varible is renamed to mice_count to make it consistent with
> > it's meaning.
> > I tested it with 4 mice connected, and works great.
> > Two possible problems:
> > - in src/gpm.c, around line 988 there's a 'FIXME??', beacuse it wasn't
> > clear for me what the original code supposed to do different for
> > the first and second mice, and why. But it works :)
> > - during argument parsing it doesn't check if the MAX_MICE_COUNT is
> > reached, so passing to much -M could make it segfault now.
> >
> >
> > Comments welcome :)
> >
> > --
> > pozsy
> >
> > _______________________________________________
> > gpm mailing list
> > gpm@lists.linux.it
> > http://lists.linux.it/listinfo/gpm
> >
>
> --
> Please send your messages pgp-signed and/or pgp-encrypted (don't encrypt mails
> to mailing list!). If you don't know what pgp is visit www.gnupg.org.
> (public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key)
>
--
pozsy
---559023410-851401618-1025457332=:2649
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="gpm-1.20.0-handle_more_mice"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.GSO.4.30.0206301915320.2649@balu>
Content-Description:
Content-Disposition: attachment; filename="gpm-1.20.0-handle_more_mice"
ZGlmZiAtTmF1ciB0My9zcmMvZ3BtLmMgZ3BtLXVodS9zcmMvZ3BtLmMNCi0t
LSB0My9zcmMvZ3BtLmMJU2F0IEZlYiAyMyAxNTo0MjoyMyAyMDAyDQorKysg
Z3BtLXVodS9zcmMvZ3BtLmMJU3VuIEp1biAgOSAyMDo1NTowMyAyMDAyDQpA
QCAtNjMsNyArNjMsNyBAQA0KICAqIGFyZSBjb3BpZWQgZGF0YSBmcm9tIG1v
dXNlX3RhYmxlWzBdIGZvciBkdWFsIG1vdXNlIG9wZXJhdGlvbi4NCiAgKi8N
CiANCi1zdHJ1Y3QgbW91c2VfZmVhdHVyZXMgbW91c2VfdGFibGVbM10gPSB7
DQorc3RydWN0IG1vdXNlX2ZlYXR1cmVzIG1vdXNlX3RhYmxlW01BWF9NSUNF
X0NPVU5UXSA9IHsNCiAgICB7DQogICAgREVGX1RZUEUsIERFRl9ERVYsIERF
Rl9TRVFVRU5DRSwNCiAgICBERUZfQkFVRCwgREVGX1NBTVBMRSwgREVGX0RF
TFRBLCBERUZfQUNDRUwsIERFRl9TQ0FMRSwgMCAvKiBzY2FsZXkgKi8sDQpA
QCAtNzcsMTAgKzc3LDExIEBADQogDQogLyogVGhlc2UgYXJlIG9ubHkgdGhl
ICdnbG9iYWwnIG9wdGlvbnMgKi8NCiANCitpbnQgbWljZV9jb3VudD0xOw0K
IGNoYXIgKm9wdF9sdXQ9REVGX0xVVDsNCiBpbnQgb3B0X3Rlc3Q9REVGX1RF
U1Q7DQogaW50IG9wdF9wdHJkcmFnPURFRl9QVFJEUkFHOw0KLWludCBvcHRf
cmVwZWF0ZXI9MCwgb3B0X2RvdWJsZT0wOw0KK2ludCBvcHRfcmVwZWF0ZXI9
MDsNCiBjaGFyKiBvcHR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