Example #1
0
        public void BuildDefaultSettings()
        {
            Joypads.Clear();
            JoypadSettings joypadSettings = new JoypadSettings();

            joypadSettings.Port   = 1;
            joypadSettings.Start  = joypadSettings.EncodeKeyboardMapping(Keys.Enter);
            joypadSettings.Select = joypadSettings.EncodeKeyboardMapping(Keys.Tab);
            joypadSettings.A      = joypadSettings.EncodeKeyboardMapping(Keys.Z);
            joypadSettings.B      = joypadSettings.EncodeKeyboardMapping(Keys.X);
            joypadSettings.Up     = joypadSettings.EncodeKeyboardMapping(Keys.Up);
            joypadSettings.Down   = joypadSettings.EncodeKeyboardMapping(Keys.Down);
            joypadSettings.Left   = joypadSettings.EncodeKeyboardMapping(Keys.Left);
            joypadSettings.Right  = joypadSettings.EncodeKeyboardMapping(Keys.Right);

            Joypads.Add(joypadSettings);

            ZapperSettings zapperSettings = new ZapperSettings();

            zapperSettings.Port       = 2;
            zapperSettings.Trigger    = "mouse:left";
            zapperSettings.LightSense = "mouse:cursor";

            Zappers.Add(zapperSettings);
        }
Example #2
0
        private void UpdateControllerLists()
        {
            Joypads.Clear();
            Zappers.Clear();

            foreach (ControllerSettings controllerSettings in controllerMap.Values)
            {
                if (controllerSettings is JoypadSettings)
                {
                    Joypads.Add((JoypadSettings)controllerSettings);
                }

                if (controllerSettings is ZapperSettings)
                {
                    Zappers.Add((ZapperSettings)controllerSettings);
                }
            }
        }