Esempio n. 1
0
 private void btnStartStop_Click(object sender, EventArgs e)
 {
     hook = new Mouse.Hook();
     hook.OnMouseLeftButtonDown += hook_OnMouseLeftButtonDown;
     hook.OnMouseLeftButtonUp += hook_OnMouseLeftButtonUp;
     hook.OnMouseXButtonUp += hook_OnMouseXButtonUp;
     hook.Start();
 }
Esempio n. 2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            rtbOutput.Text = "Hello ! What a nice day !";

            kbh = new Keyboard.Hook();
            kbh.OnKeyDown += kbh_OnKeyDown;
            kbh.OnKeyUp += kbh_OnKeyUp;

            mh = new Mouse.Hook();
            mh.OnMouseLeftButtonDown += mh_OnMouseLeftButtonDown;
            mh.OnMouseRightButtonDown += mh_OnMouseLeftButtonDown;
            mh.OnMouseMiddleButtonDown += mh_OnMouseLeftButtonDown;
            mh.OnMouseXButtonDown += mh_OnMouseLeftButtonDown;

            mh.OnMouseLeftButtonUp += mh_OnMouseLeftButtonUp;
            mh.OnMouseRightButtonUp += mh_OnMouseLeftButtonUp;
            mh.OnMouseMiddleButtonUp += mh_OnMouseLeftButtonUp;
            mh.OnMouseXButtonUp += mh_OnMouseLeftButtonUp;

            mh.OnMouseWheele += mh_OnMouseWheele;
        }