Added a work around for the "stuck cursor" issue, where the mouse cursor would stay at the resize state when entering the GameWindow.

This commit is contained in:
the_fiddler 2008-05-04 19:09:18 +00:00
parent 044299d667
commit 7164e4596b
2 changed files with 12 additions and 1 deletions

View file

@ -59,15 +59,24 @@ namespace OpenTK.Platform.Windows
#region protected override void WndProc(ref Message msg)
bool mouse_about_to_enter = false;
protected override void WndProc(ref Message msg)
{
switch ((WindowMessage)msg.Msg)
{
// Mouse events:
case WindowMessage.NCMOUSEMOVE:
mouse_about_to_enter = true; // Used to simulate a mouse enter event.
break;
case WindowMessage.MOUSEMOVE:
//case WindowMessage.NCMOUSEMOVE:
mouse.Position = new System.Drawing.Point(msg.LParam.ToInt32() & 0x0000FFFF,
(int)(msg.LParam.ToInt32() & 0xFFFF0000) >> 16);
if (mouse_about_to_enter)
{
Cursor.Current = Cursors.Default;
mouse_about_to_enter = false;
}
return;
case WindowMessage.MOUSEWHEEL:

View file

@ -369,6 +369,8 @@ namespace OpenTK.Platform.Windows
context = new GraphicsContext(mode, window);
Cursor.Current = Cursors.Default;
Debug.Unindent();
}