linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Emulating button 3 on 2 button ADB mice.
@ 2000-08-25 11:10 Malcolm Purvis
  2000-08-25 12:03 ` Michel Dänzer
  2000-08-25 12:20 ` Michael Schmitz
  0 siblings, 2 replies; 6+ messages in thread
From: Malcolm Purvis @ 2000-08-25 11:10 UTC (permalink / raw)
  To: linuxppc-dev


There is a problem in getting XFree86 4.0.1 to emulate the third mouse button
with two button ADB devices, in my case a Kensington 'Orbit' trackball.
Reviewing the archives, I see that variations of this problem have appeared in
the past but there never has been a well publicised solution.

In summary, my problem is:

1) The two buttons on the trackball map to buttons 1 and 2, when ideally they
   should be 1 and 3.

2) I cannot get XFree86 to emulate the third button when I hold down both
   buttons at once.

It should be noted that a message was posted to this list nearly a year ago
that exactly describes my symptoms:

<http://lists.linuxppc.org/listarcs/linuxppc-dev/199909/msg00135.html>

The suggested solutions, of using mousemode and xmodmap and the
Emulate3Buttons XFree86 option, did not work for that poster, and it didn't
work for me.

The cause of the problem is that the kernel (in adbmouse.c) generates busmouse
messages with the trackball buttons assigned to 1 and 2, but XFree86 (in
input/mouse/mouce.c), when emulating the third mouse button, expects two
button mice to have buttons 1 and 3!

(Note that this is cannot be fixed with xmodmap because it is the button
numbers the device driver is returning, not the X server.)

I have written a small hack for XFree86 that switches buttons 2 and 3 on bus
mice when appropriate.  The question is, is this the right place to put the
fix?  It's a very device specific solution, so really shouldn't go in user
space but, conversely, how many other programs expect the kernel to set
buttons 1 and 2 for two button mice instead of 1 and 3?

I welcome suggestions as to where to put the fix so I can submit it to the
right people.

Malcolm


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread
[parent not found: <14758.21537.701471.542545@co3018576-a.rivrw1.nsw.optushome .com.au>]
* Emulating button 3 on 2 button ADB mice
@ 2000-09-11  0:22 Etienne Herlent
  0 siblings, 0 replies; 6+ messages in thread
From: Etienne Herlent @ 2000-09-11  0:22 UTC (permalink / raw)
  To: linuxppc-dev


Hi,

This is a follow up to a message post on Fri, 25 Aug 2000 21:10:25 +1000
(EST) with the same title by Malcolm Purvis. I am having the same problem
with a 2 button Kensington mouse on my Macintoshes, but with Xpmac not
Xfree.

Here are my experiment.

hardware/software :
- G3/266/beige/Rev1 with ADB Kensington mouse with 2 buttons (I will name
it KM2), kernel 2.2.17 downloaded at ftp://ftp.kernel.org, compiled my
self, Xpmac.rage128.usb.rev9
- 6500/275 with ADB Kensington mouse with 4 buttons (it's a Thinking Mouse,
I will name it KM4), same kernel, Xpmac.rage128.usb.rev9.

The 2 mice are known as Turbo Mouse 5 by the kernel.

the symptoms :
- on the G3, it's impossible to have the third button emulated by a chord,
while it worked with a 2.2.10 kernel. In fact, this problem appeared when I
tried the 2.2.12 kernel some months ago.
- on the 6500 : all work fine.
If I switch round the 2 mice, the problem appear on the 6500 and all work
fine on the G3. This problem seams to be linked to KM2.

investigations :
here the init_turbomouse function from drivers/macintosh/mac_keyb.c :
static void init_turbomouse(int id)
{
	struct adb_request req;

	printk(" (TurboMouse 5)");
	adb_mouse_kinds[id] = ADBMOUSE_TURBOMOUSE5;
	adb_request(&req, NULL, ADBREQ_SYNC, 1, ADB_FLUSH(id));
	adb_request(&req, NULL, ADBREQ_SYNC, 1, ADB_FLUSH(3));
	adb_request(&req, NULL, ADBREQ_SYNC, 9, ADB_WRITEREG(3,2), 0xe7, 0x8c,
0, 0, 0, 0xff, 0xff, 0x94);
	adb_request(&req, NULL, ADBREQ_SYNC, 1, ADB_FLUSH(3));
	adb_request(&req, NULL, ADBREQ_SYNC, 9, ADB_WRITEREG(3,2), 0xa5, 0x14,
0, 0, 0x69, 0xff, 0xff, 0x27);
}

I replaced the "3" in the calls to ADB_FLUSH and ADB_WRITEREG by "id".
Then, the third button is emulated by a chord.

But a new bug appear : there is a delay beetween a click and the time it is
detected. For example, if, moving the mouse, I click on a title bar of a
window, I miss it ! This appear with KM2 and KM4.

I made the same expirements and noticings on the 2.2.17pre20-ben3 kernel
with Xpmac.rev10 on the G3 with KM2.

So, on the 2.2.17pre20-ben3 kernel, I replaced the init_turbomouse function
by what was in the 2.2.10 kernel :
static void init_turbomouse(int id)
{
   struct adb_request req;

   printk(" (TurboMouse 5)");
   adb_mouse_kinds[id] = ADBMOUSE_TURBOMOUSE5;
   adb_request(&req, NULL, ADBREQ_SYNC, 1, ADB_FLUSH(id));
   adb_request(&req, NULL, ADBREQ_SYNC, 3, ADB_WRITEREG(id,3), 0x20 | id, 4);
   adb_request(&req, NULL, ADBREQ_SYNC, 1, ADB_FLUSH(id));
   adb_request(&req, NULL, ADBREQ_SYNC, 9, ADB_WRITEREG(id,2), 0xe7, 0x8c,
0, 0, 0, 0xff, 0xff, 0x94);
   adb_request(&req, NULL, ADBREQ_SYNC, 1, ADB_FLUSH(id));
   adb_request(&req, NULL, ADBREQ_SYNC, 9, ADB_WRITEREG(id,2), 0xa5, 0x14,
0, 0, 0x69, 0xff, 0xff, 0x27);
}

The third button is correctly emulated, but there is always the delay on
the clicks with KM2 (I didn't try with KM4). I can't remember if there was
a delay with the 2.2.10 kernel (and I don't have this kernel anymore).

(Note to BenH : I have tried this since my last message to you.)

I don't know how ADB work, so I don't know what to do to fix the problem.
Any ideas someone ?


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Emulating button 3 on 2 button ADB mice.
@ 2006-03-21 21:56 Nick Vetter 
  0 siblings, 0 replies; 6+ messages in thread
From: Nick Vetter  @ 2006-03-21 21:56 UTC (permalink / raw)
  To: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 921 bytes --]

Dear Sir: do you have a patch for this kensington orbit trackball mouse that
I can use with Debian? If so I will post it in the pmac-Linux-nubus-users
group at the Glist site in source forge. 
 
I would also like to use it for my old powerbook 1400c which is running
debian sarge.
 
Thanks
Nick

_______________________________________
NOTICE OF CONFIDENTIALITY:  The information contained in this e-mail is intended only for the use of the individual or entity to which it is addressed and it may contain information that is privileged, confidential and exempt from disclosure under applicable law.  If you are not the intended recipient of this e-mail message, you are hereby notified that any disclosure, dissemination or copying of this communication is strictly prohibited.  If you received this communication in error, please notify and delete the original message.  Thank you for your cooperation.



[-- Attachment #2: Type: text/html, Size: 1921 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-03-21 22:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-08-25 11:10 Emulating button 3 on 2 button ADB mice Malcolm Purvis
2000-08-25 12:03 ` Michel Dänzer
2000-08-25 12:20 ` Michael Schmitz
     [not found] <14758.21537.701471.542545@co3018576-a.rivrw1.nsw.optushome .com.au>
2000-08-25 13:02 ` Franz Sirl
  -- strict thread matches above, loose matches on Subject: below --
2000-09-11  0:22 Etienne Herlent
2006-03-21 21:56 Nick Vetter 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).