private void button1_Click(object sender, EventArgs e) { inputdevices = new InputDeviceList((s) => { BeginInvoke(s); }); inputdevices.OnNewEvent += Inputdevices_OnNewEvent; DirectInputDevices.InputDeviceJoystickWindows.CreateJoysticks(inputdevices, true); DirectInputDevices.InputDeviceKeyboard.CreateKeyboard(inputdevices); // Created.. not started.. DirectInputDevices.InputDeviceMouse.CreateMouse(inputdevices); foreach (var id in inputdevices) { Print("Device " + id.ToString()); Print("Buttons: " + string.Join(",", id.EventButtonNames())); } inputdevices.Start(); }
public Devices() { _inputDeviceList = new Dictionary <byte, IInputDevice>(); _outputDevice = new Dictionary <byte, IOutputDevice>(); _shiftOffsetDevice = new ShiftOffsetDevice(); _shiftDevice = new ShiftDevice(_shiftOffsetDevice); _arcadePort1 = new ArcadePort1((int)Keys.C, (int)Keys.P1Start, (int)Keys.P2Start, (int)Keys.ArrowUp, (int)Keys.ArrowLeft, (int)Keys.ArrowRight); _arcadePort2 = new ArcadePort2((int)Keys.S, (int)Keys.F, (int)Keys.E); _soundDevice3 = new SoundDevice(3); _soundDevice5 = new SoundDevice(5); InputDeviceList.Add(1, _arcadePort1); InputDeviceList.Add(2, _arcadePort2); InputDeviceList.Add(3, _shiftDevice); OutputDeviceList.Add(2, _shiftOffsetDevice); OutputDeviceList.Add(3, _soundDevice3); OutputDeviceList.Add(4, _shiftDevice); OutputDeviceList.Add(5, _soundDevice5); }
public ActionsFromInputDevices(InputDeviceList pi, BindingsFile b, Actions.ActionController pc) { devices = pi; bf = b; ac = pc; }