public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PPC] Mac mouse emulate buttons
@ 2003-10-26 17:48 Daniele Pala
  2003-10-27  2:04 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 2+ messages in thread
From: Daniele Pala @ 2003-10-26 17:48 UTC (permalink / raw)
  To: linux-kernel; +Cc: paulus

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


--- linux-2.6.0-test8/drivers/char/keyboard.c	Tue Sep 30 18:43:22 2003
+++ linux-2.6.0-test8_mod/drivers/char/keyboard.c	Sun Oct 26 09:31:50 2003
@@ -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))




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

* Re: [PPC] Mac mouse emulate buttons
  2003-10-26 17:48 [PPC] Mac mouse emulate buttons Daniele Pala
@ 2003-10-27  2:04 ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2003-10-27  2:04 UTC (permalink / raw)
  To: Daniele Pala; +Cc: Linux Kernel list, paulus

On Sun, 2003-10-26 at 18:48, Daniele Pala wrote:
> 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.

> Cheers,
> 	Daniele
> 
> 
> --- linux-2.6.0-test8/drivers/char/keyboard.c	Tue Sep 30 18:43:22 2003
> +++ linux-2.6.0-test8_mod/drivers/char/keyboard.c	Sun Oct 26 09:31:50 2003
> @@ -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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

end of thread, other threads:[~2003-10-27  2:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-26 17:48 [PPC] Mac mouse emulate buttons Daniele Pala
2003-10-27  2:04 ` Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox