/******************************************************************************** * FUNCTION: StartControllerInput * Description: Starts the polling thread used to acquire gamepad input * Parameters: N/A ********************************************************************************/ private void StartControllerInput() { if (!ControllerPoller.IsBusy) { ControllerPoller.RunWorkerAsync(); System.Threading.Thread.Sleep(50); } }
void Poller(object sender, EventArgs ea) { ControllerPoller.Poller(gamepad, Proxy, new ControllerPoller.PanicDelegate(DoPanic), new List <RadioButton>() { InputSticksRadio, InputTriggersRadio, }, StickSensitivityNumeric, ShoulderSensitivityNumeric, ShoulderMinimumNumeric, clear_to_send, ref A_button_debounce, ref B_button_debounce, ref X_button_debounce, ref Y_button_debounce); }
private void DoInputs(object sender, EventArgs ea) { ControllerPoller.Poller(gamepad, Device, new ControllerPoller.PanicDelegate(DoPanic), new List <RadioButton>() { RemoteInputRadio, InputSticksRadio, InputTriggersRadio, }, StickSensitivityNumeric, ShoulderSensitivityNumeric, ShoulderMinimumNumeric, Device != null && Device.IsReady, ref A_button_debounce, ref B_button_debounce, ref X_button_debounce, ref Y_button_debounce); }
/******************************************************************************** * FUNCTION: StopControllerInput * Description: Terminates the gamepad polling thread * Parameters: N/A ********************************************************************************/ private void StopControllerInput() { ControllerPoller.CancelAsync(); }