Commit 68d3d806 authored by Gerard Gascón's avatar Gerard Gascón
Browse files

refactor: converted vkeycode enum into a class

parent e3f6db7a
Loading
Loading
Loading
Loading
+0 −34
Original line number Diff line number Diff line
@@ -3,40 +3,6 @@ using System.Linq;
using Domain.Input;

namespace Domain {
	public enum VKeyCode {
		A = 0x41,
		B = 0x42,
		C = 0x43,
		D = 0x44,
		E = 0x45,
		F = 0x46,
		G = 0x47,
		H = 0x48,
		I = 0x49,
		J = 0x4A,
		K = 0x4B,
		L = 0x4C,
		M = 0x4D,
		N = 0x4E,
		O = 0x4F,
		P = 0x50,
		Q = 0x51,
		R = 0x52,
		S = 0x53,
		T = 0x54,
		U = 0x55,
		V = 0x56,
		W = 0x57,
		X = 0x58,
		Y = 0x59,
		Z = 0x5A,
		Interpunct = 0x33,
		Cedilla = 0xBF,
		AccentOpen = 0xBA,
		AccentClosed = 0xDE,
		Shift = 0x10
	}

	public class CustomInput {
		private readonly List<InputReader> _readers = new();
		private readonly KeyHistory _history;
+2 −1
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ using System.Linq;

namespace Domain.Input {
	public class AObertaReader : InputReader {
		public AObertaReader(KeyHistory history) : base(history, new List<int>{ (int)VKeyCode.AccentOpen, (int)VKeyCode.A }, (int)VKeyCode.Shift, false) { }
		public AObertaReader(KeyHistory history) : base(history, new List<int> { VKeyCode.AccentOpen, VKeyCode.A },
			VKeyCode.Shift, false) { }
	}
}
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -2,6 +2,6 @@

namespace Domain.Input {
	public class CedillaReader : InputReader {
		public CedillaReader(KeyHistory history) : base(history, new List<int>{ (int)VKeyCode.Cedilla }) { }
		public CedillaReader(KeyHistory history) : base(history, new List<int> { VKeyCode.Cedilla }) { }
	}
}
 No newline at end of file
+2 −1
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ using System.Linq;

namespace Domain.Input {
	public class EObertaReader : InputReader {
		public EObertaReader(KeyHistory history) : base(history, new List<int>{ (int)VKeyCode.AccentOpen, (int)VKeyCode.E }, (int)VKeyCode.Shift, false) { }
		public EObertaReader(KeyHistory history) : base(history, new List<int> { VKeyCode.AccentOpen, VKeyCode.E },
			VKeyCode.Shift, false) { }
	}
}
 No newline at end of file
+2 −1
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ using System.Linq;

namespace Domain.Input {
	public class GeminadaReader : InputReader {
		public GeminadaReader(KeyHistory history) : base(history, new List<int>{ (int)VKeyCode.L, (int)VKeyCode.Interpunct, (int)VKeyCode.L }) { }
		public GeminadaReader(KeyHistory history) : base(history,
			new List<int> { VKeyCode.L, VKeyCode.Interpunct, VKeyCode.L }) { }
	}
}
 No newline at end of file
Loading