This commit is contained in:
2025-05-10 18:06:44 +08:00
parent e010759358
commit dea9a4f58e
47 changed files with 421 additions and 359 deletions

View File

@@ -5,9 +5,9 @@ namespace Rewired.Demos.CustomPlatform {
/// <summary>
/// An example custom keyboard input source that wraps UnityEngine.Input.
/// </summary>
public class MyPlatformUnifiedKeyboardSource : Platforms.Custom.CustomPlatformUnifiedKeyboardSource {
public class MyPlatformUnifiedKeyboardSource : Rewired.Platforms.Custom.CustomPlatformUnifiedKeyboardSource {
private static readonly KeyboardKeyCode[] keyCodes = (KeyboardKeyCode[])System.Enum.GetValues(typeof(KeyboardKeyCode));
private static readonly Rewired.KeyboardKeyCode[] keyCodes = (Rewired.KeyboardKeyCode[])System.Enum.GetValues(typeof(Rewired.KeyboardKeyCode));
protected override void OnInitialize() {
base.OnInitialize();
@@ -24,7 +24,7 @@ namespace Rewired.Demos.CustomPlatform {
// Set a single key label
map.Set(
new KeyPropertyMap.Key() {
keyCode = KeyboardKeyCode.A,
keyCode = Rewired.KeyboardKeyCode.A,
label = "[A]"
}
);
@@ -32,9 +32,9 @@ namespace Rewired.Demos.CustomPlatform {
// Set multiple of key labels at the same time
map.Set(
new [] {
new KeyPropertyMap.Key() { keyCode = KeyboardKeyCode.B, label = "[B]" },
new KeyPropertyMap.Key() { keyCode = KeyboardKeyCode.C, label = "[C]" },
new KeyPropertyMap.Key() { keyCode = KeyboardKeyCode.D, label = "[D]" }
new KeyPropertyMap.Key() { keyCode = Rewired.KeyboardKeyCode.B, label = "[B]" },
new KeyPropertyMap.Key() { keyCode = Rewired.KeyboardKeyCode.C, label = "[C]" },
new KeyPropertyMap.Key() { keyCode = Rewired.KeyboardKeyCode.D, label = "[D]" }
}
);