ADB mouse driver

Giuliano Pochini (pochini@denise.shiny.it)
Mon, 17 May 1999 19:46:06 MET DST


Some weeks ago I asked about how to include my changes to the ADB
(Macintosh) mouse driver. Well, since I was unable to contact any on
the maintainers of this driver, I post it in this message, hoping
someone will take it into consideration...

-=-=-=-=-=-=
--- v2.2.9/linux/drivers/macintosh/mac_keyb.c Thu May 13 23:41:02
1999
+++ linux/drivers/macintosh/mac_keyb.c Mon May 17 15:51:22 1999
@@ -24,4 +24,5 @@
* - Hunter digital (NoHandsMouse)
* - Kensignton TurboMouse 5 (needs testing)
+ * - MacAlly 2 button mouse (needs testing)
*
* To do:
@@ -269,4 +270,5 @@
#define ADBMOUSE_MICROSPEED 6 /* Microspeed mouse (&trackball ?),
MacPoint */
#define ADBMOUSE_TRACKBALLPRO 7 /* Trackball Pro (special buttons)
*/
+#define ADBMOUSE_MACALLY2 8 /* MacAlly 2-button mouse */

static int adb_mouse_kinds[16];
@@ -487,4 +489,16 @@
high bits of y-axis motion. XY is additional
high bits of x-axis motion.
+
+ MacAlly 2-button mouse protocol.
+
+ For MacAlly 2-button mouse protocol the data array will contain
the
+ following values:
+
+ BITS COMMENTS
+ data[0] = dddd 1100 ADB command: Talk, register 0, for device
dddd.
+ data[1] = bxxx xxxx Left button and x-axis motion.
+ data[2] = byyy yyyy Right button and y-axis motion.
+ data[3] = ???? ???? unknown
+ data[4] = ???? ???? unknown
*/
struct kbd_struct *kbd;
@@ -513,4 +527,9 @@
data[3] = (data[3] & 0x77) | ((data[3] & 0x02) << 6);
break;
+ case ADBMOUSE_MACALLY2:
+ data[3] = (data[2] & 0x80) ? 0x80 : 0x00; //Second button is
mapped as button 3, so
+ data[2] |= 0x80; //you don't need to fiddle with
xmodmap
+ nb=4; //to make it work properly.
+ break;
}

@@ -807,4 +826,14 @@
(req.reply[3] == 0x4c) && (req.reply[4] == 0x31))
init_turbomouse(id);
+ else if ((req.reply_len == 9) &&
+ (req.reply[1] == 0x4b) && (req.reply[2] == 0x4f) &&
+ (req.reply[3] == 0x49) && (req.reply[4] == 0x54)){
+ if (adb_try_handler_change(id, 0x42)) {
+ printk("ADB MacAlly 2-button mouse at %d, handler
set to 0x42", id);
+ adb_mouse_kinds[id] = ADBMOUSE_MACALLY2;
+ }
+
+ }
+
}
printk("\n");
-=-=-=-=-=-=

Bye.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/