public static List<GenericInput> GetNewInputDevices(IntPtr windowHandle, List<GenericInput> currentDevices)
        {
            List<GenericInput> newDevices = new List<GenericInput>();

            List<GenericInput> inputDevices = InputManager.GetInputDevices();

            foreach (GenericInput g in inputDevices)
            {
                if (g.DeviceInstanceId == "PATIENT")
                    return newDevices;
            }

            VideoController input = new VideoController();

            if (input.connected == true)
                newDevices.Add(input);

            return newDevices;
        }
Exemplo n.º 2
0
        private void AddInputDevice(GenericInput input)
        {
            Type typeToSearchFor;

            if (input.GetType() == typeof(CAVEDirectInput))
                InputManager.CAVEInput = (CAVEDirectInput)input;

            if (input.GetType() == typeof(CheckInController))
                InputManager.CheckInController = (CheckInController)input;

            if (input.GetType() == typeof(DatabaseController))
                InputManager.DatabaseController = (DatabaseController)input;

            if (input.GetType() == typeof(VideoController))
                InputManager.VideoController = (VideoController)input;

            if (input.GetType() == typeof(KeyboardInput))
                typeToSearchFor = typeof(JoystickInput);
            else if (input.GetType() == typeof(JoystickInput))
                typeToSearchFor = typeof(SpeechInput);
            else if (input.GetType() == typeof(SpeechInput))
                typeToSearchFor = typeof(WiiMoteInput);
            else
            {
                Console.WriteLine("Added " + input.DeviceName + " at last position");
                inputDevices.Add(input);
                return;
            }

            for (int i = 0; i < inputDevices.Count; i++)
            {
                if (inputDevices[i].GetType() == typeToSearchFor)
                {
                    Console.WriteLine("Added " + input.DeviceName + " at position " + i);

                    inputDevices.Insert(i, input);
                    return;
                }
            }

            Console.WriteLine("Added " + input.DeviceName + " at last position");
            inputDevices.Add(input);
        }