mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-01-22 16:30:26 +01:00
Improve VirtualKeyCode to ToWindowsInput mapping
This commit is contained in:
parent
26171639eb
commit
801f32a719
|
|
@ -20,18 +20,6 @@ namespace SteamController.Devices
|
|||
{
|
||||
}
|
||||
|
||||
public bool this[ProfilesSettings.VirtualKeyCode key]
|
||||
{
|
||||
get { return this[(VirtualKeyCode)key]; }
|
||||
set { this[(VirtualKeyCode)key] = value; }
|
||||
}
|
||||
|
||||
public bool this[System.Windows.Input.Key key]
|
||||
{
|
||||
get { return this[(VirtualKeyCode)System.Windows.Input.KeyInterop.VirtualKeyFromKey(key)]; }
|
||||
set { this[(VirtualKeyCode)System.Windows.Input.KeyInterop.VirtualKeyFromKey(key)] = value; }
|
||||
}
|
||||
|
||||
public bool this[System.Windows.Forms.Keys key]
|
||||
{
|
||||
get
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
using SteamController.ProfilesSettings;
|
||||
|
||||
namespace SteamController.Profiles
|
||||
{
|
||||
public abstract class DefaultBackPanelShortcutsProfile : DefaultGuideShortcutsProfile
|
||||
|
|
@ -20,10 +22,10 @@ namespace SteamController.Profiles
|
|||
{
|
||||
var settings = BackPanelSettings;
|
||||
|
||||
c.Keyboard[settings.L4_KEY] = c.Steam.BtnL4;
|
||||
c.Keyboard[settings.L5_KEY] = c.Steam.BtnL5;
|
||||
c.Keyboard[settings.R4_KEY] = c.Steam.BtnR4;
|
||||
c.Keyboard[settings.R5_KEY] = c.Steam.BtnR5;
|
||||
c.Keyboard[settings.L4_KEY.ToWindowsInput()] = c.Steam.BtnL4;
|
||||
c.Keyboard[settings.L5_KEY.ToWindowsInput()] = c.Steam.BtnL5;
|
||||
c.Keyboard[settings.R4_KEY.ToWindowsInput()] = c.Steam.BtnR4;
|
||||
c.Keyboard[settings.R5_KEY.ToWindowsInput()] = c.Steam.BtnR5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -389,4 +389,17 @@ namespace SteamController.ProfilesSettings
|
|||
// Windows 2000/XP: Start Application 2 key
|
||||
LAUNCH_APP2 = 183
|
||||
}
|
||||
|
||||
public static class VirtualKeyCodeExtensions
|
||||
{
|
||||
public static WindowsInput.VirtualKeyCode ToWindowsInput(this VirtualKeyCode code)
|
||||
{
|
||||
return (WindowsInput.VirtualKeyCode)code;
|
||||
}
|
||||
|
||||
public static WindowsInput.VirtualKeyCode ToWindowsInput(this System.Windows.Input.Key key)
|
||||
{
|
||||
return (WindowsInput.VirtualKeyCode)System.Windows.Input.KeyInterop.VirtualKeyFromKey(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue