Exemple #1
0
		public MainForm()
		{
			InitializeComponent();

			// get currSpeed on init and save it in _i
			SystemParametersInfo(SpiGetmousespeed, 0, ref _initialSpeed, 0);

			//_initialSpeed = 12;

			//labelMouseSpeed.Text = initialSpeed.ToString();

			var activityHook = new UserActivityHook();

			// hook events
			activityHook.OnMouseActivity += new MouseEventHandler(
				async (object o, MouseEventArgs e) => await MouseMoved(o, e));
		}
Exemple #2
0
        public AppContext()
        {
            Application.ApplicationExit += OnApplicationExit;
            InitializeComponent();
            _trayIcon.Visible = true;

            // get current mouse speed on application init
            SystemParametersInfo(SpiGetmousespeed, 0, ref _initialSpeed, 0);

            var activityHook = new UserActivityHook();

            // hook mouse moved event
            activityHook.OnMouseActivity += async (o, e) => await MouseMoved(o, e);

            //activityHook.KeyDown += new KeyEventHandler(MyKeyDown);
            //activityHook.KeyPress += new KeyPressEventHandler(MyKeyPress);
            //activityHook.KeyUp += new KeyEventHandler(MyKeyUp);
        }