private void cbActive_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { L2Key.getInstance().Emulate(keyTimer.HWnd, keyTimer.Key); } }
public static L2Key getInstance() { if (null == instance) { instance = new L2Key(); } return(instance); }
public static L2Key getInstance() { if (null == instance) { instance = new L2Key(); } return instance; }
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()); }
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); } }
public void Emulate() { L2Key.getInstance().Emulate(window.HWnd, code); }
private void textBox_KeyDown(object sender, KeyEventArgs e) { textBox.Text = L2Key.CodeToKeyName((uint)e.KeyCode); code = (int)e.KeyCode; }
public void SetKey(uint scancode) { tbKey.Text = L2Key.CodeToKeyName(scancode); }
private void tbAttack_KeyDown(object sender, KeyEventArgs e) { ((TextBox)sender).Text = L2Key.CodeToKeyName((uint)e.KeyCode); }