Skip to content

Commit

Permalink
chore: Update Last input type for gamepad
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Oct 5, 2024
1 parent c285bd1 commit 336d0bf
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Uno.UI/UI/Xaml/Internal/InputManager.Keyboard.skia.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
using Windows.UI.Core;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Input;
using Windows.System;
using DirectUI;
using Uno.UI.Xaml.Input;

namespace Uno.UI.Xaml.Core;

Expand Down Expand Up @@ -50,7 +53,14 @@ public void Init(object host)

private void OnKey(KeyEventArgs args, bool down)
{
_inputManager.LastInputDeviceType = Input.InputDeviceType.Keyboard;
if (XboxUtility.IsGamepadNavigationInput(args.VirtualKey))
{
_inputManager.LastInputDeviceType = InputDeviceType.GamepadOrRemote;
}
else
{
_inputManager.LastInputDeviceType = InputDeviceType.Keyboard;
}

var originalSource1 = FocusManager.GetFocusedElement(_inputManager.ContentRoot.XamlRoot) as UIElement ?? _inputManager.ContentRoot.VisualTree.RootElement;

Expand Down

0 comments on commit 336d0bf

Please sign in to comment.