コード例 #1
0
 public InputManager(
     INPUT_DEVICE_TYPE inputType,
     IInputDeviceFactory inputFactory,
     ITimeManagerFactory timeFactory,
     IInputAlgorithms inputAlgorithms)
 {
     this.inputDevice            = inputFactory.Get(inputType: inputType);
     this.inputType              = inputType;
     this.timeFactory            = timeFactory;
     this.inputAlgorithms        = inputAlgorithms;
     this.downPressLock          = new object();
     this.inputQueue             = new InputQueue();
     this.backgroundInputActions = new List <IInputAction>();
     this.downPressLocation      = new PointI[10];
     this._activePointerStates   = new Dictionary <uint, PointerData>();
 }
コード例 #2
0
        public IInputDevice Get(INPUT_DEVICE_TYPE type)
        {
            if (AppModelStatus.IsInAppContainer)
            {
                switch (type)
                {
                case INPUT_DEVICE_TYPE.TOUCH:
                    return(new InputDeviceTouch());

                case INPUT_DEVICE_TYPE.PEN:
                    return(new InputDevicePen());

                case INPUT_DEVICE_TYPE.MOUSE:
                    return(new InputDeviceMouse());

                case INPUT_DEVICE_TYPE.KEYBOARD:
                    return(new InputDeviceKeyboard());

                default:
                    throw new ArgumentException(message: string.Format(format: "Invalid input device type {0}", arg0: type));
                }
            }

            switch (type)
            {
            case INPUT_DEVICE_TYPE.TOUCH:
                return(new InputDeviceTouchRIMLegacy());

            case INPUT_DEVICE_TYPE.PEN:
                return(new InputDevicePenRIM());

            case INPUT_DEVICE_TYPE.MOUSE:
                return(new InputDeviceMouseRIM());

            case INPUT_DEVICE_TYPE.KEYBOARD:
                return(new InputDeviceKeyboardRIM());

            default:
                throw new ArgumentException(message: string.Format(format: "Invalid input device type {0}", arg0: type));
            }
        }