Exemple #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            mainform = new Frm_MJOY_Main();

            // the action overlay is the overlay which shows the virtual keyboard.

            VKoverlay = new actionoverlay();

            // set actionoverlay position
            foreach (var scrn in Screen.AllScreens)
            {
                if (scrn.Bounds.Contains(VKoverlay.Location))
                {
                    VKoverlay.Location = new Point(scrn.Bounds.Right - VKoverlay.Width, scrn.Bounds.Top);
                    break;
                }
            }

            // set the overlay forms properties.
            // 0.7.2
            //VKoverlay.BackColor = System.Drawing.Color.White;
            //VKoverlay.TransparencyKey = System.Drawing.Color.White;
            VKoverlay.Show(); // we need to show it here else it will
                              // not show up at all.
            VKoverlay.TopMost = true;
            VKoverlay.Hide();

            // this is the main poller for the controls.
            controlpoller = new XInputController(mainform);

            // create an about form
            aboutform      = new Frm_About();
            aboutform.Text = aboutform.Text + " v" + Application.ProductVersion;
            aboutform.Hide();

            // create a config form.
            configform = new Frm_ButtonConfig();
            configform.Hide();

            Log.Line("Startup config 2: " + Properties.Settings.Default.StartupConfig);

            Running = true;

            Application.Run(mainform);
        }
Exemple #2
0
        public XInputController(Frm_MJOY_Main frm)
        {
            config = new MJConfig();

            string loadconfigfile = Properties.Settings.Default.StartupConfig;

            Log.Line("Startup config 1: " + Properties.Settings.Default.StartupConfig);

            // maybe load a config, maybe create the default one.
            if (loadconfigfile[0] != '!')
            {
                config.LoadFrom(loadconfigfile);
            }
            else
            {
                config.loadHardcodedDefaultConfig();
            }

            this.mainForm = frm;
            this.connectThread();
        }