Ejemplo n.º 1
0
        public void Add(KeyboardEventInfo kei)
        {
            try
            {
                System.Diagnostics.Debug.Assert(_Recording == true, "StartRecording() must be called before adding steps");

                if (_Recording == true)
                    _Sequence.Add(DateTime.Now, kei);
            }
            catch
            {
                throw;
            }
        }
Ejemplo n.º 2
0
        public void Add(KeyboardEventInfo kei)
        {
            try
            {
                System.Diagnostics.Debug.Assert(_Recording == true, "StartRecording() must be called before adding steps");

                if (_Recording == true)
                {
                    _Sequence.Add(DateTime.Now, kei);
                }
            }
            catch
            {
                throw;
            }
        }
Ejemplo n.º 3
0
Archivo: frmMain.cs Proyecto: sbec/KB
        private void KeyboardListener_s_KeyEventHandler(object sender, EventArgs e)
        {
            try
            {
                KeyboardListener.UniversalKeyEventArgs eventArgs = (KeyboardListener.UniversalKeyEventArgs)e;
                KeyboardEventInfo kei = new KeyboardEventInfo(eventArgs);

                if (Config.Current.IgnoredKeys.Contains((int)eventArgs.m_Key))
                    return;

                WindowInfo curWindow = new WindowInfo(GetForegroundWindow());
                
                if (_Windows.Contains(curWindow) == true)
                {
                    if (Active == true)
                    {
                        //WriteLog(string.Format("SEND : {0} - {1:X} - {2:X}", ((Keys) kei.m_Key).ToString(), kei.m_Msg, kei.lParam));
                        foreach (WindowInfo i in _Windows)
                        {
                            if (i.Equals(curWindow) == false)
                                kei.PostMessage(i.Handle);
                        }
                    }

                    if (_Recorder != null && _Recorder.Recording == true)
                    {
                        //WriteLog(string.Format("RECORD : {0} - {1:X} - {2:X}", ((Keys)kei.m_Key).ToString(), kei.m_Msg, kei.lParam));
                        _Recorder.Add(kei);
                    }
                }
            }
            catch (Exception ex)
            {
                Utils.ShowError(ex);
            }

        }