Skip to contentSkip to conversation

Mac mouse emulate buttons

PPC Daniele Pala 2 participants 2 messages Oct 26, 2003 – Oct 27, 2003 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

Mouse button emulation doesn't work in the console, because the expression

if ((raw_mode = (kbd->kbdmode == VC_RAW)))

never gets true. So i moved the call to mac_hid_mouse_emulate_buttons outside the emulate_raw function. Mouse emulation sucks, but i'm too poor to buy a 3-buttons mouse :)

I'm not subscribed to the list, please CC me privately

Cheers,
Daniele

drivers/char/keyboard.c +5 -5
@@ -964,11 +964,6 @@
 static int emulate_raw(struct vc_data *vc, unsigned int keycode, 
 		       unsigned char up_flag)
 {
-#ifdef CONFIG_MAC_EMUMOUSEBTN
-	if (mac_hid_mouse_emulate_buttons(1, keycode, !up_flag))
-		return 0;
-#endif /* CONFIG_MAC_EMUMOUSEBTN */
-
 	if (keycode > 255 || !x86_keycodes[keycode])
 		return -1; 
 
@@ -1039,6 +1034,11 @@
 #endif
 
 	rep = (down == 2);
+
+#ifdef CONFIG_MAC_EMUMOUSEBTN
+        if(mac_hid_mouse_emulate_buttons(1, keycode, down << 7))
+		return;
+#endif /* CONFIG_MAC_EMUMOUSEBTN */
 
 	if ((raw_mode = (kbd->kbdmode == VC_RAW)))
 		if (emulate_raw(vc, keycode, !down << 7))
#1 lore raw
Quoted 9 lines · Daniele Pala

Mouse button emulation doesn't work in the console, because the expression

if ((raw_mode = (kbd->kbdmode == VC_RAW)))

never gets true. So i moved the call to mac_hid_mouse_emulate_buttons outside the emulate_raw function. Mouse emulation
sucks, but i'm too poor to buy a 3-buttons mouse :)

I'm not subscribed to the list, please CC me privately

Thanks, Can you CC me further Mac related issues ?

That code should be moved to a separate module, afaik, the input layer allows stacking of such "filtering" modules now, though I haven't looked at the details.

Ben.

Quoted 38 lines

Cheers,
Daniele

drivers/char/keyboard.c +5 -6
@@ -964,11 +964,6 @@
 static int emulate_raw(struct vc_data *vc, unsigned int keycode, 
 		       unsigned char up_flag)
 {
-#ifdef CONFIG_MAC_EMUMOUSEBTN
-	if (mac_hid_mouse_emulate_buttons(1, keycode, !up_flag))
-		return 0;
-#endif /* CONFIG_MAC_EMUMOUSEBTN */
-
 	if (keycode > 255 || !x86_keycodes[keycode])
 		return -1; 
 
@@ -1039,6 +1034,11 @@
 #endif
 
 	rep = (down == 2);
+
+#ifdef CONFIG_MAC_EMUMOUSEBTN
+        if(mac_hid_mouse_emulate_buttons(1, keycode, down << 7))
+		return;
+#endif /* CONFIG_MAC_EMUMOUSEBTN */
 
 	if ((raw_mode = (kbd->kbdmode == VC_RAW)))
 		if (emulate_raw(vc, keycode, !down << 7))
 
 
 
-

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/