.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.IO;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
using Engine;
|
||||
using Engine.Graphics;
|
||||
@@ -55,6 +56,8 @@ public partial class App : Application
|
||||
|
||||
private class InputHandlerWrapper : IInputHandler
|
||||
{
|
||||
public CultureInfo CurrentInputLanguage => _inputHandler?.CurrentInputLanguage ?? new CultureInfo(1033);
|
||||
|
||||
public Vector2 MousePosition => _inputHandler?.MousePosition ?? Vector2.Zero;
|
||||
|
||||
private IInputHandler? _inputHandler;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Windows;
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using Engine.Input;
|
||||
using OpenTK.Mathematics;
|
||||
@@ -7,6 +8,7 @@ namespace PresenterWpf;
|
||||
|
||||
public class WpfInputHandler : IInputHandler
|
||||
{
|
||||
public CultureInfo CurrentInputLanguage { get; private set; }
|
||||
public Vector2 MousePosition => _mousePosition;
|
||||
|
||||
private readonly Window _window;
|
||||
@@ -35,6 +37,11 @@ public class WpfInputHandler : IInputHandler
|
||||
|
||||
public void Update(double parDeltaTime)
|
||||
{
|
||||
_window.Dispatcher.Invoke(() =>
|
||||
{
|
||||
CurrentInputLanguage = InputLanguageManager.Current.CurrentInputLanguage;
|
||||
});
|
||||
|
||||
for (var i = 0; i < _currentKeys.Length; i++)
|
||||
{
|
||||
_previousKeys[i] = _currentKeys[i];
|
||||
|
||||
Reference in New Issue
Block a user