Demos/BeatPad/BeatPadKeys.cs
using System.Collections.Generic;
namespace Sandbox.BeatPad;
// QWERTY -> pad map, bottom-to-top so physical-down == grid-down. Keys are
// Goo.Input.KnownKeys engine names: uppercase letters, digit chars. Numpad is
// intentionally unsupported (not in KnownKeys; we stay inside Goo's input layer).
public static class BeatPadKeys
{
static readonly Dictionary<string, int> Map = new()
{
["1"] = 12, ["2"] = 13, ["3"] = 14, ["4"] = 15, // top pad row
["Q"] = 8, ["W"] = 9, ["E"] = 10, ["R"] = 11,
["A"] = 4, ["S"] = 5, ["D"] = 6, ["F"] = 7,
["Z"] = 0, ["X"] = 1, ["C"] = 2, ["V"] = 3, // bottom pad row
};
public static bool TryMap(string engineName, out int pad) => Map.TryGetValue(engineName, out pad);
public static IEnumerable<int> AllMappedPads() => Map.Values;
}