Ejemplo n.º 1
0
        /// <summary>
        /// Construct a new wiimote provider.
        /// </summary>
        public WiiPointerProvider()
        {
            lastpoint   = new WiimoteLib.Point();
            lastpoint.X = 0;
            lastpoint.Y = 0;

            this.settingsControl = new WiiPointerProviderSettings();

            this.ScreenSize = new Vector(Util.ScreenWidth, Util.ScreenHeight);

            this.smoothingBuffer = new SmoothingBuffer(3);

            this.duoTouch = new DuoTouch(Util.ScreenBounds, 3, 1);

            this.keyMapper = new WiiKeyMapper(1);

            this.keyMapper.OnButtonDown    += WiiButton_Down;
            this.keyMapper.OnButtonUp      += WiiButton_Up;
            this.keyMapper.OnConfigChanged += WiiKeyMap_ConfigChanged;
            this.keyMapper.SendConfigChangedEvt();

            this.inputSimulator = new InputSimulator();

            this.showPointer = true;
            if (this.showPointer && !this.mouseMode)
            {
                this.duoTouch.enableHover();
            }
            else
            {
                this.duoTouch.disableHover();
            }

            screenPositionCalculator = new ScreenPositionCalculator();
        }
Ejemplo n.º 2
0
        public DuoTouch(System.Drawing.Rectangle screenBounds, int smoothSize, ulong startId)
        {
            this.masterID = startId;
            this.slaveID  = startId + 1;
            this.startID  = startId;

            this.masterPriority = (int)masterID;
            this.slavePriority  = (int)slaveID;

            this.screenBounds = screenBounds;
            if (smoothSize < 1)
            {
                smoothSize = 1;
            }
            this.smoothingBuffer = new SmoothingBuffer(smoothSize);
        }