Exemplo n.º 1
0
        IEnumerator<ITask> OnChangeJoystickHandler(OnChangeJoystick onChangeJoystick)
        {
            if (onChangeJoystick.DriveControl == _driveControl)
            {
                // TT Dec-2006 - Copied from V1.0
//                yield return Arbiter.Choice(
//                    _joystickPort.ChangeController(onChangeJoystick.Joystick),
                Activate(Arbiter.Choice(
                    _gameControllerPort.ChangeController(onChangeJoystick.Joystick),
                    delegate(DefaultUpdateResponseType response)
                    {
                        LogInfo("Changed Joystick");
                    },
                    delegate(Fault f)
                    {
                        LogError(null, "Unable to change Joystick", f);
                    })
                );
            }
            // TT Dec-2006 - Copied from V1.0
            yield break;
        }
Exemplo n.º 2
0
        private void cbJoystick_SelectedIndexChanged(object sender, EventArgs e)
        {
            IEnumerable<joystick.Controller> list = cbJoystick.Tag as IEnumerable<joystick.Controller>;

            if (list != null)
            {
                if (cbJoystick.SelectedIndex >= 0)
                {
                    int index = 0;
                    foreach (joystick.Controller controller in list)
                    {
                        if (index == cbJoystick.SelectedIndex)
                        {
                            OnChangeJoystick change = new OnChangeJoystick(this);
                            change.Joystick = controller;

                            _eventsPort.PostUnknownType(change);

                            return;
                        }
                        index++;
                    }
                }
            }
        }