Пример #1
0
        public Workspace(RuntimeContext runtimeContext)
        {
            Debug.Assert(null != runtimeContext, "Argument runtimeContext was null");

            this.runtimeContext = runtimeContext;

            zones = new List<Zone>();
            inputState = new InputState();
            zoneScanner = new Timer();

            zoneScanner.Interval = 100;
            zoneScanner.Tick += new EventHandler(zoneScanner_Tick);
            zoneScanner.Start();

            HookManager.MouseMoveExt += new EventHandler<MouseEventExtArgs>(HookManager_MouseMoveExt);
            HookManager.MouseDown += new System.Windows.Forms.MouseEventHandler(HookManager_MouseDown);
            HookManager.MouseUp += new System.Windows.Forms.MouseEventHandler(HookManager_MouseUp);
            HookManager.BeforeProcesssing += new EventHandler(HookManager_BeforeProcesssing);
        }
Пример #2
0
        void HookManager_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            inputState.MouseX = e.X;
            inputState.MouseY = e.Y;
            AcquireWindowIfPossible();

            //reset the whole thing because the user no longer taking action we care about.
            //TODO: analyze if i really have to reset the input state.
            inputState = new InputState();
        }