public virtual void OnKeyPress(IntPtr wParam, IntPtr lParam) { var pressedKey = Marshal.ReadInt32(lParam); var virtualKey = (VirtualKeys)pressedKey; PressedKey = KeyMap.GetKey(virtualKey); }