예제 #1
0
 public TabletSettings()
 {
     PenPressureThreshold = _DEFAULT_PEN_THRESHOLD;
     MovementType         = TabletMovementType.Absolute;
     MovementSpeed        = _DEFAULT_MOVEMENT_SPEED;
     Precision            = _DEFAULT_PRECISION;
     AllowFingerMovement  = _DEFAULT_ALLOW_FINGER_MOVEMENT;
     AAction                 = (TabletOptionButton.ButtonAction)Enum.Parse(typeof(TabletOptionButton.ButtonAction), _DEFAULT_A_ACTION);
     BAction                 = (TabletOptionButton.ButtonAction)Enum.Parse(typeof(TabletOptionButton.ButtonAction), _DEFAULT_B_ACTION);
     XAction                 = (TabletOptionButton.ButtonAction)Enum.Parse(typeof(TabletOptionButton.ButtonAction), _DEFAULT_X_ACTION);
     YAction                 = (TabletOptionButton.ButtonAction)Enum.Parse(typeof(TabletOptionButton.ButtonAction), _DEFAULT_Y_ACTION);
     UpAction                = (TabletOptionButton.ButtonAction)Enum.Parse(typeof(TabletOptionButton.ButtonAction), _DEFAULT_UP_ACTION);
     DownAction              = (TabletOptionButton.ButtonAction)Enum.Parse(typeof(TabletOptionButton.ButtonAction), _DEFAULT_DOWN_ACTION);
     LeftAction              = (TabletOptionButton.ButtonAction)Enum.Parse(typeof(TabletOptionButton.ButtonAction), _DEFAULT_LEFT_ACTION);
     RightAction             = (TabletOptionButton.ButtonAction)Enum.Parse(typeof(TabletOptionButton.ButtonAction), _DEFAULT_RIGHT_ACTION);
     StartAction             = (TabletOptionButton.ButtonAction)Enum.Parse(typeof(TabletOptionButton.ButtonAction), _DEFAULT_START_ACTION);
     BackAction              = (TabletOptionButton.ButtonAction)Enum.Parse(typeof(TabletOptionButton.ButtonAction), _DEFAULT_BACK_ACTION);
     GuideAction             = (TabletOptionButton.ButtonAction)Enum.Parse(typeof(TabletOptionButton.ButtonAction), _DEFAULT_GUIDE_ACTION);
     ClickAction             = (TabletOptionButton.ButtonAction)Enum.Parse(typeof(TabletOptionButton.ButtonAction), _DEFAULT_CLICK_ACTION);
     PeopleAction            = (TabletOptionButton.ButtonAction)Enum.Parse(typeof(TabletOptionButton.ButtonAction), _DEFAULT_PEOPLE_ACTION);
     CurrentDisplay          = TabletOptions.GetDeviceName(Screen.PrimaryScreen.DeviceName);
     AllowAllDisplays        = _DEFAULT_ALLOW_ALL_DISPLAYS;
     MaintainAspectRatio     = _DEFAULT_MAINTAIN_ASPECT_RATIO;
     RestrictToCurrentWindow = _DEFAULT_RESTRICT_TO_CURRENT_WINDOW;
     HorizontalDock          = _DEFAULT_HORIZONTAL_DOCK;
     VerticalDock            = _DEFAULT_VERTICAL_DOCK;
     PPJoyNumber             = _DEFAULT_PPJOY_NUMBER;
 }
예제 #2
0
        private void btnSlotSettings_Click(object sender, EventArgs e)
        {
            //Find out which one we're dealing with
            bool isPS3        = (sender == btnPS3Settings);
            bool isController = false;
            int? index        = null;

            if (!isPS3)
            {
                //Find which 360 slot
                foreach (var slot in _slots)
                {
                    if (sender == slot.Button)
                    {
                        index = slot.Index;
                        break;
                    }
                }

                if (MouseInterface.Receiver != null)
                {
                    var info = MouseInterface.Receiver.GetDeviceInformation(index.Value);

                    if (info != null)
                    {
                        isController = (info.Subtype == Xbox360USB.WirelessReceiver.DeviceSubtype.Controller);
                    }
                }
            }

            string fileName = MouseInterface.GetSettingsFileName(isPS3, index);

            if (!String.IsNullOrEmpty(fileName))
            {
                var frm = new TabletOptions(isController, fileName, TabletSettings.LoadSettings(fileName));
                frm.ShowDialog();
                frm.Dispose();

                MouseInterface.ReloadSettings();
            }
        }
예제 #3
0
        private void btnSlotSettings_Click(object sender, EventArgs e)
        {
            //Find out which one we're dealing with
              bool isPS3 = (sender == btnPS3Settings);
              bool isController = false;
              int? index = null;
              if (!isPS3 && !(sender is WiiTabletDevice))
              {
            //Find which 360 slot
            foreach (var slot in _slots)
            {
              if (sender == slot.Button)
              {
            index = slot.Index;
            break;
              }
            }

            if (MouseInterface.Receiver != null)
            {
              var info = MouseInterface.Receiver.GetDeviceInformation(index.Value);

              if (info != null)
            isController = (info.Subtype == Xbox360USB.WirelessReceiver.DeviceSubtype.Controller);
            }
              }

              string fileName = MouseInterface.GetSettingsFileName(sender is WiiTabletDevice, isPS3, index);
              if (!String.IsNullOrEmpty(fileName))
              {
            var frm = new TabletOptions(isController, fileName, TabletSettings.LoadSettings(fileName));
            frm.ShowDialog();
            frm.Dispose();

            MouseInterface.ReloadSettings();
              }
        }