コード例 #1
0
        private void _StartInterface()
        {
            MouseInterface.Start(this);

            if (MouseInterface.Receiver != null)
            {
                MouseInterface.Receiver.DeviceConnected    += Receiver_DeviceChanged;
                MouseInterface.Receiver.DeviceDisconnected += Receiver_DeviceChanged;
            }
        }
コード例 #2
0
        private void _StopInterface()
        {
            MouseInterface.Stop();

            if (MouseInterface.Receiver != null)
            {
                MouseInterface.Receiver.DeviceConnected    -= Receiver_DeviceChanged;
                MouseInterface.Receiver.DeviceDisconnected -= Receiver_DeviceChanged;
            }
        }
コード例 #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)
            {
                //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();
            }
        }