NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-mac68k/58672: Change request [PATCH] Emulated buttons only sent on mouse click



The following reply was made to PR port-mac68k/58672; it has been noted by GNATS.

From: Nat Sloss <nathanialsloss%yahoo.com.au@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: port-mac68k/58672: Change request [PATCH] Emulated buttons only sent on mouse click
Date: Sun, 15 Sep 2024 09:34:39 +1000

 --Boundary-00=_P2h5mqU6M4b8EzS
 Content-Type: Text/Plain;
   charset="iso-8859-15"
 Content-Transfer-Encoding: 7bit
 
 Here is the attached patch:
 
 
 --Boundary-00=_P2h5mqU6M4b8EzS
 Content-Type: text/x-patch;
   charset="ISO-8859-1";
   name="toapply.7.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
 	filename="toapply.7.diff"
 
 --- a/sys/arch/mac68k/dev/ams.c	Thu Sep 12 21:47:15 2024 +0000
 +++ b/sys/arch/mac68k/dev/ams.c	Sun Sep 15 05:56:15 2024 +1000
 @@ -499,15 +499,27 @@ ms_processevent(adb_event_t *event, stru
  	new_event.u.m.dy = ((signed int) (event->bytes[0] & 0x3f)) -
  				((event->bytes[0] & 0x40) ? 64 : 0);
  
 +	int phys_buttons = new_event.u.m.buttons;
  #if NAED > 0
  	if (!aed_input(&new_event))
  #endif
  #if NWSMOUSE > 0
 -		if (amsc->sc_wsmousedev != NULL) /* wsmouse is attached? */
 +		if (amsc->sc_wsmousedev != NULL)  { /* wsmouse is attached? */
 +			if ((phys_buttons != new_event.u.m.buttons) &&
 +							    (phys_buttons & 1))
 +				amsc->sc_oldbuttons =
 +				    new_event.u.m.buttons & ~1;
 +			else if ((phys_buttons == new_event.u.m.buttons) &&
 +						    (amsc->sc_oldbuttons == 0))
 +				amsc->sc_oldbuttons = phys_buttons;
 +
 +			if (phys_buttons == 0)
 +				amsc->sc_oldbuttons = 0;
  			wsmouse_input(amsc->sc_wsmousedev,
 -			    new_event.u.m.buttons,
 +			    amsc->sc_oldbuttons,
  			    new_event.u.m.dx, -new_event.u.m.dy, 0, 0,
  			    WSMOUSE_INPUT_DELTA);
 +		}
  #else
  		/* do nothing */ ;
  #endif
 --- a/sys/arch/mac68k/dev/amsvar.h	Thu Sep 12 21:47:15 2024 +0000
 +++ b/sys/arch/mac68k/dev/amsvar.h	Sun Sep 15 05:56:15 2024 +1000
 @@ -45,6 +45,7 @@ struct ams_softc {
  	/* Extended Mouse Protocol info, faked for non-EMP mice */
  	u_int8_t	sc_class;	/* mouse class (mouse, trackball) */
  	u_int8_t	sc_buttons;	/* number of buttons */
 +	u_int8_t	sc_oldbuttons;	/* button state */
  	u_int32_t	sc_res;		/* mouse resolution (dpi) */
  	char		sc_devid[5];	/* device indentifier */
  
 
 --Boundary-00=_P2h5mqU6M4b8EzS--
 


Home | Main Index | Thread Index | Old Index