Пример #1
0
 private void cbActive_MouseDown(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Right)
     {
         L2Key.getInstance().Emulate(keyTimer.HWnd, keyTimer.Key);
     }
 }
Пример #2
0
 public static L2Key getInstance()
 {
     if (null == instance)
     {
         instance = new L2Key();
     }
     return(instance);
 }
Пример #3
0
 public static L2Key getInstance()
 {
     if (null == instance)
     {
         instance = new L2Key();
     }
     return instance;
 }
Пример #4
0
        public KeyTimer(Control parent, int index)
        {
            parentPanel = parent;
            panel       = KeyTimerPanel.CreatePanel(this);
            panel.Top   = index * (panel.Height + 2);
            panel.Width = parent.Width - 20;
            this.index  = index;
            // находим элементы
            tbKey       = panel.Controls.Find("tbKey", true).First() as TextBox;
            nudInterval = panel.Controls.Find("nudInterval", true).First() as NumericUpDown;
            cbActive    = panel.Controls.Find("cbActive", true).First() as CheckBox;

            Key      = (int)L2Key.KeyNameToCode(tbKey.Text);
            Interval = int.Parse(nudInterval.Value.ToString());
        }
Пример #5
0
        public void CheckTime()
        {
            TimeSpan span        = DateTime.Now - startTime;
            int      miliSeconds = (int)span.TotalMilliseconds;

            while (miliSeconds < 0)
            {
                // Выход за границы диапазона
                startTime   = startTime.AddDays(7);
                span        = DateTime.Now - startTime;
                miliSeconds = (int)span.TotalMilliseconds;
            }

            int miliInterval = interval * 1000;
            int cnt          = miliSeconds / miliInterval + 1;

            panel.TimeDisplayUpdate(miliSeconds, miliInterval);
            if (cnt > iteration)
            {
                iteration = cnt;
                L2Key.getInstance().Emulate(HWnd, key);
            }
        }
Пример #6
0
 public void Emulate()
 {
     L2Key.getInstance().Emulate(window.HWnd, code);
 }
Пример #7
0
 private void textBox_KeyDown(object sender, KeyEventArgs e)
 {
     textBox.Text = L2Key.CodeToKeyName((uint)e.KeyCode);
     code         = (int)e.KeyCode;
 }
Пример #8
0
 public void SetKey(uint scancode)
 {
     tbKey.Text = L2Key.CodeToKeyName(scancode);
 }
Пример #9
0
 private void tbAttack_KeyDown(object sender, KeyEventArgs e)
 {
     ((TextBox)sender).Text = L2Key.CodeToKeyName((uint)e.KeyCode);
 }