private void PipeMessageRecieved(string Reply) { var command = Reply.Split(' '); NEHKeyState state = command[0] == "0" ? NEHKeyState.KeyDown : NEHKeyState.KeyUp; int KeyCode = int.Parse(command[1]); Key key = KeyInterop.KeyFromVirtualKey(KeyCode); NEHKeyPressEventArgs eventArgs = new NEHKeyPressEventArgs(state, key, KeyCode); KeyEventRecieved?.Invoke(this, eventArgs); }
public NEHKeyPressEventArgs(NEHKeyState state, Key key, int keyCode) { State = state; Key = key; KeyCode = keyCode; }