Example #1
0
        public frmInputConfig()
        {
            InitializeComponent();
            if (DesignMode)
            {
                return;
            }

            Task.Run(() => {
                InputApi.UpdateInputDevices();
            });

            InputConfig cfg = ConfigManager.Config.Input.Clone();

            Entity = cfg;

            BaseConfigForm.InitializeComboBox((ComboBox)cboPlayer1, typeof(ControllerType), ControllerType.SuperScope);
            BaseConfigForm.InitializeComboBox((ComboBox)cboPlayer2, typeof(ControllerType));

            BaseConfigForm.InitializeComboBox((ComboBox)cboMultitap1, typeof(ControllerType), ControllerType.None, ControllerType.Multitap, ControllerType.SnesMouse, ControllerType.SuperScope);
            BaseConfigForm.InitializeComboBox((ComboBox)cboMultitap2, typeof(ControllerType), ControllerType.None, ControllerType.Multitap, ControllerType.SnesMouse, ControllerType.SuperScope);
            BaseConfigForm.InitializeComboBox((ComboBox)cboMultitap3, typeof(ControllerType), ControllerType.None, ControllerType.Multitap, ControllerType.SnesMouse, ControllerType.SuperScope);
            BaseConfigForm.InitializeComboBox((ComboBox)cboMultitap4, typeof(ControllerType), ControllerType.None, ControllerType.Multitap, ControllerType.SnesMouse, ControllerType.SuperScope);

            cboPlayer1.SetEnumValue(cfg.Controllers[0].Type);
            cboPlayer2.SetEnumValue(cfg.Controllers[1].Type);

            cboMultitap1.SetEnumValue(ControllerType.SnesController);
            cboMultitap2.SetEnumValue(ControllerType.SnesController);
            cboMultitap3.SetEnumValue(ControllerType.SnesController);
            cboMultitap4.SetEnumValue(ControllerType.SnesController);

            AddBinding(nameof(InputConfig.DisplayInputPort1), chkDisplayPort1);
            AddBinding(nameof(InputConfig.DisplayInputPort2), chkDisplayPort2);
            AddBinding(nameof(InputConfig.DisplayInputPort3), chkDisplayPort3);
            AddBinding(nameof(InputConfig.DisplayInputPort4), chkDisplayPort4);
            AddBinding(nameof(InputConfig.DisplayInputPort5), chkDisplayPort5);
            AddBinding(nameof(InputConfig.DisplayInputPosition), cboDisplayInputPosition);
            AddBinding(nameof(InputConfig.DisplayInputHorizontally), chkDisplayInputHorizontally);
            AddBinding(nameof(InputConfig.ControllerDeadzoneSize), trkControllerDeadzoneSize);

            UpdateUiSections();
        }
Example #2
0
        public frmGetKey(bool singleKeyMode)
        {
            InitializeComponent();
            _singleKeyMode = singleKeyMode;
            if (_singleKeyMode)
            {
                tableLayoutPanel1.RowStyles[1].SizeType = SizeType.Absolute;
                tableLayoutPanel1.RowStyles[1].Height   = 0;
            }
            if (_singleKeyMode)
            {
                lblCurrentKeys.Height  = 1;
                lblCurrentKeys.Visible = false;
            }
            ShortcutKey = new KeyCombination();
            InputApi.UpdateInputDevices();
            InputApi.ResetKeyState();

            //Prevent other keybindings from interfering/activating
            InputApi.DisableAllKeys(true);
        }