Пример #1
0
        public static void CheckMouseClick(IntPtr wParam, IntPtr lParam, Recording recording)
        {
            recording.Delay = InterceptDelays.getDelay();

            if ((MouseMessages)wParam == MouseMessages.WM_LBUTTONDOWN)
            {
                recording.MouseClick = "Left";
            }
            else if ((MouseMessages)wParam == MouseMessages.WM_RBUTTONDOWN)
            {
                recording.MouseClick = "Right";
            }

            RecordingList.AddToList(recording);
        }
Пример #2
0
        private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam)
        {
            if (nCode >= 0 && wParam == (IntPtr)WM_KEYDOWN)
            {
                var recording = new Recording();
                int vkCode    = Marshal.ReadInt32(lParam);

                recording.Delay    = InterceptDelays.getDelay();
                recording.KeyPress = ((Keys)vkCode);

                RecordingList.AddToList(recording);
            }

            return(CallNextHookEx(App, nCode, wParam, lParam));
        }