public void CustomKeyButton_KeyPressedEvent(object sender, CustomKeyButton.KeyPressedEventArgs e) { CustomKeyButton.CustomKeyButton ckb = (CustomKeyButton.CustomKeyButton)sender; if (shiftindicator == true) KeyToLower(); switch (e.KeyboardKeyPressed) { case "CAPS": EnableCaps(); break; case "SHIFT": EnableShift(); break; case "TAB": SendKeys.SendWait("{TAB}"); break; case "<": SendKeys.SendWait("{BACKSPACE}"); break; case "SPACE": SendKeys.SendWait(" "); break; default: SendKeys.SendWait(e.KeyboardKeyPressed); break; } //Raise Key Pressed Event KeyboardEventArgs dea = new KeyboardEventArgs(e.KeyboardKeyPressed); OnUserKeyPressed(dea); }
protected virtual void OnUserKeyPressed(KeyboardEventArgs e) { if (UserKeyPressed != null) UserKeyPressed(this, e); }