Ejemplo n.º 1
0
        /// <summary>
        /// Shows the keyboard.
        /// </summary>
        private void ShowKeyboard()
        {
            var popup = new OnScreenKeyboardForm(IsNumeric, isCapsLock, isNumLock, isShift, isAlt, isCtrl);
            int posX;

            if (IsNumeric)
            {
                posX          = Left;
                locationPoint = GetPosition(posX, popup);
                popup.Width   = numFormWidth;
                popup.Height  = numFormHeight;
            }
            else
            {
                posX          = (Left + Width / 2) - popup.Width / 2;
                locationPoint = GetPosition(posX, popup);
            }

            popup.LocationPoint = locationPoint;
            popup.Show();
        }
Ejemplo n.º 2
0
        public App()
        {
            // WARNING: The order of the initializations below is important. See comments for details

            // Setting environment variables
            Environment.SetEnvironmentVariable("SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS", "0", EnvironmentVariableTarget.User); // Prevents full screen apps (mostly games) using SDL from minizing on focus loss

            // Creating the instance of our main form here. This will guarantee a WindowsFormsSynchronizationContext
            // instance is created and available for future use
            mainForm = new MainForm();

            // Holding onto a reference of the WindowsFormsSynchronizationContext instance for use running some code
            // on the main windows forms thread when necessary
            synchronizationContext = (WindowsFormsSynchronizationContext)SynchronizationContext.Current;

            messageOnlyForm        = new MessageOnlyForm();
            notificationForm       = new NotificationForm();
            stickyNotificationForm = new StickyNotificationForm();
            onScreenKeyboardForm   = new OnScreenKeyboardForm(synchronizationContext);

            notificationManager = new NotificationManager(synchronizationContext);
            notificationManager.NotificationForm       = notificationForm;
            notificationManager.StickyNotificationForm = stickyNotificationForm;

            systemMonitor = new SystemMonitor();
            systemMonitor.Run();

            keyboardInputMonitor = new KeyboardInputMonitor();
            keyboardInputMonitor.Init();

            controllerInputManager = new ControllerInputManager();
            controllerInputManager.Init();

            new SteamUtils(PATH_DIRECTORY_STEAM).InstallAppBanners();

            //Loading the main UI
            MessageBus.Bus.Instance.Publish(new UIEvent {
                Action = UIEvent.EventAction.ShowHomeScreen
            });
        }