private bool UpdateFrame() { if (!_isActive) { return(true); } if (_isStopped) { return(false); } NpadManager.Update(); // Touchscreen bool hasTouch = false; // Get screen touch position if (!_enableMouse) { hasTouch = TouchScreenManager.Update(true, (_inputManager.MouseDriver as SDL2MouseDriver).IsButtonPressed(MouseButton.Button1), _aspectRatio.ToFloat()); } if (!hasTouch) { TouchScreenManager.Update(false); } Device.Hid.DebugPad.Update(); return(true); }
public void Initialize(Switch device, List <InputConfig> inputConfigs, bool enableKeyboard, bool enableMouse) { Device = device; Renderer = Device.Gpu.Renderer; NpadManager.Initialize(device, inputConfigs, enableKeyboard, enableMouse); TouchScreenManager.Initialize(device); }
public void Initialize(Switch device) { Device = device; Renderer = Device.Gpu.Renderer; Renderer.Window?.SetSize(_windowWidth, _windowHeight); if (Renderer != null) { Renderer.ScreenCaptured += Renderer_ScreenCaptured; } NpadManager.Initialize(device, ConfigurationState.Instance.Hid.InputConfig, ConfigurationState.Instance.Hid.EnableKeyboard, ConfigurationState.Instance.Hid.EnableMouse); TouchScreenManager.Initialize(device); }
protected virtual void Dispose(bool disposing) { if (disposing) { _isActive = false; TouchScreenManager?.Dispose(); NpadManager.Dispose(); SDL2Driver.Instance.UnregisterWindow(_windowId); SDL_DestroyWindow(WindowHandle); SDL2Driver.Instance.Dispose(); } }
public void Exit() { TouchScreenManager?.Dispose(); NpadManager?.Dispose(); if (_isStopped) { return; } _isStopped = true; _isActive = false; _exitEvent.WaitOne(); _exitEvent.Dispose(); }
public void Initialize(Switch device, List <InputConfig> inputConfigs, bool enableKeyboard, bool enableMouse) { Device = device; IRenderer renderer = Device.Gpu.Renderer; if (renderer is ThreadedRenderer tr) { renderer = tr.BaseRenderer; } Renderer = renderer; NpadManager.Initialize(device, inputConfigs, enableKeyboard, enableMouse); TouchScreenManager.Initialize(device); }
public void Exit() { TouchScreenManager?.Dispose(); NpadManager?.Dispose(); if (_isStopped) { return; } _gpuCancellationTokenSource.Cancel(); _isStopped = true; _isActive = false; _exitEvent.WaitOne(); _exitEvent.Dispose(); }
public void Initialize(Switch device) { Device = device; IRenderer renderer = Device.Gpu.Renderer; if (renderer is ThreadedRenderer tr) { renderer = tr.BaseRenderer; } Renderer = renderer; Renderer?.Window?.SetSize(WindowWidth, WindowHeight); if (Renderer != null) { Renderer.ScreenCaptured += Renderer_ScreenCaptured; } NpadManager.Initialize(device, ConfigurationState.Instance.Hid.InputConfig, ConfigurationState.Instance.Hid.EnableKeyboard, ConfigurationState.Instance.Hid.EnableMouse); TouchScreenManager.Initialize(device); }
private void txtDisplayName_MouseClick(object sender, MouseEventArgs e) { TouchScreenManager.ShowOSK(this.txtDisplayName); }
private void txtDescription_MouseClick(object sender, MouseEventArgs e) { TouchScreenManager.ShowOSK(this.txtDescription); }
private void txtDuplicatesCount_MouseClick(object sender, MouseEventArgs e) { TouchScreenManager.ShowOSK(this.txtDuplicatesCount); }
private void txtSerialNumber_MouseClick(object sender, MouseEventArgs e) { TouchScreenManager.ShowOSK(this.txtSerialNumber); }
private void txtMaterialDisplayName1_MouseClick(object sender, MouseEventArgs e) { TouchScreenManager.ShowOSK(txtMaterialDisplayName1); }
private void txtMaterialDisplayName1_Enter(object sender, EventArgs e) { TouchScreenManager.ShowOSK(txtMaterialDisplayName1); }
private bool UpdateFrame() { if (!_isActive) { return(true); } if (_isStopped) { return(false); } if ((Toplevel as MainWindow).IsFocused) { Application.Invoke(delegate { KeyboardStateSnapshot keyboard = _keyboardInterface.GetKeyboardStateSnapshot(); HandleScreenState(keyboard); if (keyboard.IsPressed(Key.Delete)) { if (!ParentWindow.State.HasFlag(WindowState.Fullscreen)) { Ptc.Continue(); } } }); } NpadManager.Update(ConfigurationState.Instance.Graphics.AspectRatio.Value.ToFloat()); if ((Toplevel as MainWindow).IsFocused) { KeyboardHotkeyState currentHotkeyState = GetHotkeyState(); if (currentHotkeyState.HasFlag(KeyboardHotkeyState.ToggleVSync) && !_prevHotkeyState.HasFlag(KeyboardHotkeyState.ToggleVSync)) { Device.EnableDeviceVsync = !Device.EnableDeviceVsync; } if ((currentHotkeyState.HasFlag(KeyboardHotkeyState.Screenshot) && !_prevHotkeyState.HasFlag(KeyboardHotkeyState.Screenshot)) || ScreenshotRequested) { ScreenshotRequested = false; Renderer.Screenshot(); } _prevHotkeyState = currentHotkeyState; } // Touchscreen bool hasTouch = false; // Get screen touch position if ((Toplevel as MainWindow).IsFocused && !ConfigurationState.Instance.Hid.EnableMouse) { hasTouch = TouchScreenManager.Update(true, (_inputManager.MouseDriver as GTK3MouseDriver).IsButtonPressed(MouseButton.Button1), ConfigurationState.Instance.Graphics.AspectRatio.Value.ToFloat()); } if (!hasTouch) { TouchScreenManager.Update(false); } Device.Hid.DebugPad.Update(); return(true); }
private void txtInputValue_MouseClick(object sender, MouseEventArgs e) { TouchScreenManager.ShowOSK(this.txtInputValue); }
private void txtSlicerStartIndex_MouseClick(object sender, MouseEventArgs e) { TouchScreenManager.ShowOSK(this.txtSlicerStartIndex); }