コード例 #1
0
        public static void CreateKeyboard(InputDeviceList ilist)
        {
            DirectInput dinput = new DirectInput();

            foreach (DeviceInstance di in dinput.GetDevices(DeviceClass.Keyboard, DeviceEnumerationFlags.AttachedOnly))
            {
                InputDeviceKeyboard k = new InputDeviceKeyboard(dinput, di);
                ilist.Add(k);
            }
        }
コード例 #2
0
        public static void CreateMouse(InputDeviceList ilist)
        {
            DirectInput dinput = new DirectInput();

            foreach (DeviceInstance di in dinput.GetDevices(DeviceClass.Pointer, DeviceEnumerationFlags.AttachedOnly))
            {
                InputDeviceMouse k = new InputDeviceMouse(dinput, di);
                ilist.Add(k);
            }
        }
コード例 #3
0
        public static void CreateJoysticks(InputDeviceList ilist, bool axisevents)
        {
            DirectInput dinput = new DirectInput();

            foreach (DeviceInstance di in dinput.GetDevices(DeviceClass.GameControl, DeviceEnumerationFlags.AttachedOnly))
            {
                //   if (di.InstanceName.Contains("Logitech"))
                {
                    InputDeviceJoystickWindows j = new InputDeviceJoystickWindows(dinput, di, axisevents);
                    ilist.Add(j);
                }
            }
        }