public InputHandler()
{
player1 = new vJoy();
player2 = new vJoy();
///// Write access to vJoy Device - Basic
VjdStat status = player1.GetVJDStatus(1);
// Acquire the target
string prt;
if ((status == VjdStat.VJD_STAT_OWN) ||
((status == VjdStat.VJD_STAT_FREE) && (!player1.AcquireVJD(1))))
prt = String.Format("Failed to acquire vJoy device number {0}.", 1);
else
prt = String.Format("Acquired: vJoy device number {0}.", 1);
MessageBox.Show(prt);
status = player2.GetVJDStatus(2);
// Acquire the target
if ((status == VjdStat.VJD_STAT_OWN) ||
((status == VjdStat.VJD_STAT_FREE) && (!player2.AcquireVJD(2))))
prt = String.Format("Failed to acquire vJoy device number {0}.", 2);
else
prt = String.Format("Acquired: vJoy device number {0}.", 2);
MessageBox.Show(prt);
usersList = new Dictionary<string, uint>();
commands = new Dictionary<string, Delegate>();
commands["left"] = new Func<uint, vJoy, bool>(Left);
commands["right"] = new Func<uint, vJoy, bool>(Right);
commands["up"] = new Func<uint, vJoy, bool>(Up);
commands["down"] = new Func<uint, vJoy, bool>(Down);
commands["a"] = new Func<uint, vJoy, bool>(A);
commands["b"] = new Func<uint, vJoy, bool>(B);
commands["start"] = new Func<uint, vJoy, bool>(Start);
commands["c1"] = commands["z"] = new Func<uint, vJoy, bool>(C1);
commands["c2"] = new Func<uint, vJoy, bool>(C2);
commands["c3"] = new Func<uint, vJoy, bool>(C3);
commands["c4"] = new Func<uint, vJoy, bool>(C4);
commands["rb"] = new Func<uint, vJoy, bool>(RB);
commands["lb"] = new Func<uint, vJoy, bool>(LB);
commands["none"] = new Func<uint, vJoy, bool>(None);
}