refactor: converted keycodes into an enum

This commit is contained in:
Gerard Gascón 2024-04-17 17:21:28 +02:00
parent 2cae1eced7
commit e3f6db7ae5
15 changed files with 58 additions and 19 deletions

View file

@ -3,6 +3,6 @@ using System.Linq;
namespace Domain.Input {
public class AObertaReader : InputReader {
public AObertaReader(KeyHistory history) : base(history, new List<int>{ 0xBA, 0x41 }, 0x10, false) { }
public AObertaReader(KeyHistory history) : base(history, new List<int>{ (int)VKeyCode.AccentOpen, (int)VKeyCode.A }, (int)VKeyCode.Shift, false) { }
}
}

View file

@ -2,6 +2,6 @@
namespace Domain.Input {
public class CedillaReader : InputReader {
public CedillaReader(KeyHistory history) : base(history, new List<int>{ 0xBF }) { }
public CedillaReader(KeyHistory history) : base(history, new List<int>{ (int)VKeyCode.Cedilla }) { }
}
}

View file

@ -3,6 +3,6 @@ using System.Linq;
namespace Domain.Input {
public class EObertaReader : InputReader {
public EObertaReader(KeyHistory history) : base(history, new List<int>{ 0xBA, 0x45 }, 0x10, false) { }
public EObertaReader(KeyHistory history) : base(history, new List<int>{ (int)VKeyCode.AccentOpen, (int)VKeyCode.E }, (int)VKeyCode.Shift, false) { }
}
}

View file

@ -3,6 +3,6 @@ using System.Linq;
namespace Domain.Input {
public class GeminadaReader : InputReader {
public GeminadaReader(KeyHistory history) : base(history, new List<int>{ 76, 0x33, 76 }) { }
public GeminadaReader(KeyHistory history) : base(history, new List<int>{ (int)VKeyCode.L, (int)VKeyCode.Interpunct, (int)VKeyCode.L }) { }
}
}

View file

@ -3,6 +3,6 @@ using System.Linq;
namespace Domain.Input {
public class IDieresiReader : InputReader {
public IDieresiReader(KeyHistory history) : base(history, new List<int>{ 0xDE, 0x49 }, 0x10, true) { }
public IDieresiReader(KeyHistory history) : base(history, new List<int>{ (int)VKeyCode.AccentClosed, (int)VKeyCode.I }, (int)VKeyCode.Shift, true) { }
}
}

View file

@ -3,6 +3,6 @@ using System.Linq;
namespace Domain.Input {
public class IxReader : InputReader {
public IxReader(KeyHistory history) : base(history, new List<int>{ 0x49, 0x58 }) { }
public IxReader(KeyHistory history) : base(history, new List<int>{ (int)VKeyCode.I, (int)VKeyCode.X }) { }
}
}

View file

@ -3,6 +3,6 @@ using System.Linq;
namespace Domain.Input {
public class LlReader : InputReader {
public LlReader(KeyHistory history) : base(history, new List<int>{ 0x4C, 0x4C }) { }
public LlReader(KeyHistory history) : base(history, new List<int>{ (int)VKeyCode.L, (int)VKeyCode.L }) { }
}
}

View file

@ -3,6 +3,6 @@ using System.Linq;
namespace Domain.Input {
public class NyReader : InputReader {
public NyReader(KeyHistory history) : base(history, new List<int>{ 0x4E, 0x59 }) { }
public NyReader(KeyHistory history) : base(history, new List<int>{ (int)VKeyCode.N, (int)VKeyCode.Y }) { }
}
}

View file

@ -3,6 +3,6 @@ using System.Linq;
namespace Domain.Input {
public class OObertaReader : InputReader {
public OObertaReader(KeyHistory history) : base(history, new List<int>{ 0xBA, 0x4F }, 0x10, false) { }
public OObertaReader(KeyHistory history) : base(history, new List<int>{ (int)VKeyCode.AccentOpen, (int)VKeyCode.O }, (int)VKeyCode.Shift, false) { }
}
}

View file

@ -3,6 +3,6 @@ using System.Linq;
namespace Domain.Input {
public class SsReader : InputReader {
public SsReader(KeyHistory history) : base(history, new List<int>{ 0x53, 0x53 }) { }
public SsReader(KeyHistory history) : base(history, new List<int>{ (int)VKeyCode.S, (int)VKeyCode.S }) { }
}
}

View file

@ -3,6 +3,6 @@ using System.Linq;
namespace Domain.Input {
public class TgReader : InputReader {
public TgReader(KeyHistory history) : base(history, new List<int>{ 0x54, 0x47 }) { }
public TgReader(KeyHistory history) : base(history, new List<int>{ (int)VKeyCode.T, (int)VKeyCode.G }) { }
}
}

View file

@ -3,6 +3,6 @@ using System.Linq;
namespace Domain.Input {
public class TjReader : InputReader {
public TjReader(KeyHistory history) : base(history, new List<int>{ 0x54, 0x4A }) { }
public TjReader(KeyHistory history) : base(history, new List<int>{ (int)VKeyCode.T, (int)VKeyCode.J }) { }
}
}

View file

@ -3,6 +3,6 @@ using System.Linq;
namespace Domain.Input {
public class TxReader : InputReader {
public TxReader(KeyHistory history) : base(history, new List<int>{ 0x54, 0x58 }) { }
public TxReader(KeyHistory history) : base(history, new List<int>{ (int)VKeyCode.T, (int)VKeyCode.X }) { }
}
}