@@ -77,17 +77,6 @@ public void SyncControls(IEmulator emulator, IMovieSession session, Config confi
7777			ControllerOutput . Source  =  session . MovieOut ; 
7878		} 
7979
80- 		public  void  ToggleStickies ( ) 
81- 		{ 
82- 			StickyHoldController . MassToggleStickyState ( ActiveController . PressedButtons ) ; 
83- 			StickyAutofireController . MassToggleStickyState ( AutoFireController . PressedButtons ) ;  // does this even make sense? 
84- 		} 
85- 
86- 		public  void  ToggleAutoStickies ( ) 
87- 		{ 
88- 			StickyAutofireController . MassToggleStickyState ( ActiveController . PressedButtons ) ; 
89- 		} 
90- 
9180		private  static   Controller  BindToDefinition ( 
9281			ControllerDefinition  def , 
9382			IDictionary < string ,  Dictionary < string ,  string > >  allBinds , 
@@ -233,6 +222,8 @@ public void RunControllerChain(Config config)
233222			ClientControls . LatchFromPhysical ( _hotkeyCoalescer ) ; 
234223
235224			// controller, which actually has a chain 
225+ 			List < string >  oldPressedButtons  =  ActiveController . PressedButtons ; 
226+ 
236227			ActiveController . LatchFromPhysical ( ControllerInputCoalescer ) ; 
237228			ActiveController . OR_FromLogical ( ClickyVirtualPadController ) ; 
238229			AutoFireController . LatchFromPhysical ( ControllerInputCoalescer ) ; 
@@ -242,13 +233,25 @@ public void RunControllerChain(Config config)
242233				ActiveController . ApplyAxisConstraints ( "Natural Circle" ) ; 
243234			} 
244235
245- 			if  ( ClientControls [ "Autohold" ] ) 
246- 			{ 
247- 				ToggleStickies ( ) ; 
248- 			} 
249- 			else  if  ( ClientControls [ "Autofire" ] ) 
236+ 			if  ( ClientControls [ "Autohold" ]  ||  ClientControls [ "Autofire" ] ) 
250237			{ 
251- 				ToggleAutoStickies ( ) ; 
238+ 				List < string >  newPressedButtons  =  ActiveController . PressedButtons ; 
239+ 				List < string >  justPressedButtons  =  new ( ) ; 
240+ 				foreach  ( string  button  in  newPressedButtons ) 
241+ 				{ 
242+ 					if  ( ! oldPressedButtons . Contains ( button ) )  justPressedButtons . Add ( button ) ; 
243+ 				} 
244+ 				if  ( justPressedButtons . Count  !=  0 ) 
245+ 				{ 
246+ 					if  ( ClientControls [ "Autohold" ] ) 
247+ 					{ 
248+ 						StickyHoldController . MassToggleStickyState ( justPressedButtons ) ; 
249+ 					} 
250+ 					else 
251+ 					{ 
252+ 						StickyAutofireController . MassToggleStickyState ( justPressedButtons ) ; 
253+ 					} 
254+ 				} 
252255			} 
253256
254257			// autohold/autofire must not be affected by the following inputs 
0 commit comments