Ejemplo n.º 1
0
 /// <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);
     }
 }
Ejemplo n.º 2
0
 private void AgentOnHotkeyTriggered(object sender, HotkeyEventArgs e)
 {
     if(e.Mapping.LastPress + DoubleTapPrevention.TotalMilliseconds > Environment.TickCount) return;
     e.Mapping.LastPress = Environment.TickCount;
     e.Mapping.Action();
 }
Ejemplo n.º 3
0
 private void OnIncrement(object sender, HotkeyEventArgs e)
 {
     Value++;
     e.Handled = true;
 }
Ejemplo n.º 4
0
 private void OnHotkeyTriggered(HotkeyEventArgs e)
 {
     var handler = HotkeyTriggered;
     if(handler != null) handler(this, e);
 }
Ejemplo n.º 5
0
 /// <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);
 }