public KeyboardHook() { // register the event of the inner native window. _window.KeyPressed += delegate(object sender, KeyPressedEventArgs args) { if (KeyPressed != null) KeyPressed(this, args); }; }