private void OnKeyHold(object sender, KeyHoldEventArgs e) { if (e.KeyInfo.IsAlphaNumeric) { e.Handled = true; } }
public KeyBindEventArgs(KeyHoldEventArgs keyHoldEvent, KeyValuePair <string, string[]> binding, Action onHookPauseRequest, Action onHookResumeRequest) { KeyHoldEvent = keyHoldEvent; Binding = binding; handled = false; this.onHookPauseRequest = onHookPauseRequest; this.onHookResumeRequest = onHookResumeRequest; }
private void OnKeyUp(object sender, KeyHoldEventArgs e) { KeyValuePair <string, string[]> binding; if (this.GetBind(e.KeyInfo, out binding)) { KeyBindEventArgs eventArgs = new KeyBindEventArgs(e, binding, onHookPauseRequest, onHookResumeRequest); this.KeyUpEvent?.Invoke(this, eventArgs); } }
public void OnKeyDown(object caller, KeyHoldEventArgs e) { if (this.window.IsActive) { if (e.KeyInfo.IsWordChar || e.KeyEventArgs.KeyCode == Keys.Back) { this.WindowHideEvent?.Invoke(this, new EventArgs()); this.window.SendKey(e.KeyInfo.Key); e.Handled = true; } else if (e.KeyEventArgs.KeyCode == Keys.Escape) { this.WindowHideEvent?.Invoke(this, new EventArgs()); e.Handled = true; } } }