private void Macro_Load(object sender, EventArgs e) { actHook = new InputHook.UserActivityHook(true, true); // crate an instance with global hooks // hang on events actHook.OnMouseActivity += new MouseEventHandler(MouseActivity); actHook.KeyDown += new KeyEventHandler(MyKeyDown); actHook.KeyPress += new KeyPressEventHandler(MyKeyPress); actHook.KeyUp += new KeyEventHandler(MyKeyUp); }