Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            label1.Text   = "";
            textBox7.Text = "";
            if (checkBox1.Checked)
            {
                CountDownForm countdown = new CountDownForm();
                countdown.DoCountDown(5);
            }

            this.Enabled = false;

            engine.startRecord();
        }
Esempio n. 2
0
        private int KeyboardHookFunction(int nCode, Int32 wParam, IntPtr lParam)
        {
            LowAPI.API_Structs.KeyboardHookStruct keyboardHookStruct = (LowAPI.API_Structs.KeyboardHookStruct)Marshal.PtrToStructure(lParam, typeof(LowAPI.API_Structs.KeyboardHookStruct));

            self.setTextboxText(nCode + "," +
                                wParam + "," +
                                keyboardHookStruct.scanCode + "," +
                                keyboardHookStruct.vkCode + "," +
                                keyboardHookStruct.time + "," +
                                keyboardHookStruct.flags + "," +
                                keyboardHookStruct.dwExtraInfo);

            if (eStatus.playing)
            {
                if (keyboardHookStruct.scanCode == 69)
                {
                    eStatus.stop();
                    UserEvents.Pause.Reset();
                    if (MessageBox.Show(new Form {
                        TopMost = true
                    }, "Play paused, continue ?", "Tracking message", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        eStatus.play();
                    }

                    UserEvents.Pause.Set();
                }
            }

            if (eStatus.recording)
            {
                if (keyboardHookStruct.scanCode == 69)
                {
                    eStatus.stop();
                    DialogResult Ret = (DialogResult)self.InvokeDelegate(new ShowInRecordDialogDelegate(ShowInRecordDialog));
                    if (Ret == DialogResult.Cancel)
                    {
                        self.enableDisplay();
                        self.setLabelText("");
                    }
                    if (Ret == DialogResult.Retry)
                    {
                        CountDownForm countdown = new CountDownForm();
                        countdown.DoCountDown(3);

                        TimeDiff.init();
                        eStatus.record();
                        return(API_Functions.CallNextHookEx(KeyboardHoocID, nCode, wParam, lParam));
                    }
                }
            }

            if (eStatus.recording)
            {
                DelayAction Delay = new DelayAction();
                Delay.milisecs = TimeDiff.Get();
                UserEvents.Items.Add(Delay);

                KeyboardAction keyboardAction = new KeyboardAction();
                keyboardAction.SetKeyboardActionData(nCode, wParam, keyboardHookStruct);
                UserEvents.Items.Add(keyboardAction);


                self.setTextboxText(nCode + "," +
                                    wParam + "," +
                                    keyboardHookStruct.scanCode + "," +
                                    keyboardHookStruct.vkCode + "," +
                                    keyboardHookStruct.time + "," +
                                    keyboardHookStruct.flags + "," +
                                    keyboardHookStruct.dwExtraInfo +
                                    Delay.milisecs);
            }

            return(API_Functions.CallNextHookEx(KeyboardHoocID, nCode, wParam, lParam));
        }