/// <summary> /// 引发 <see cref="Hotkey"/> 的 <see cref="Hotkey.HotkeyDown"/> 事件。 /// </summary> /// <param name="e">参数。</param> protected virtual void OnHotkeyDown(HotkeyEventArgs e) { if (this.HotkeyDown != null) { this.HotkeyDown(this, e); } }
private void AgentOnHotkeyTriggered(object sender, HotkeyEventArgs e) { if(e.Mapping.LastPress + DoubleTapPrevention.TotalMilliseconds > Environment.TickCount) return; e.Mapping.LastPress = Environment.TickCount; e.Mapping.Action(); }
private void OnIncrement(object sender, HotkeyEventArgs e) { Value++; e.Handled = true; }
private void OnHotkeyTriggered(HotkeyEventArgs e) { var handler = HotkeyTriggered; if(handler != null) handler(this, e); }
/// <summary> /// 引发 <see cref="Hotkey"/> 的 <see cref="Hotkey.HotkeyDown"/> 事件。 /// </summary> /// <param name="e">参数。</param> protected virtual void OnHotkeyDown(HotkeyEventArgs e) { if(this.HotkeyDown != null) this.HotkeyDown(this, e); }