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:
parent
044299d667
commit
7164e4596b
2 changed files with 12 additions and 1 deletions
|
@ -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:
|
||||
|
|
|
@ -369,6 +369,8 @@ namespace OpenTK.Platform.Windows
|
|||
|
||||
context = new GraphicsContext(mode, window);
|
||||
|
||||
Cursor.Current = Cursors.Default;
|
||||
|
||||
Debug.Unindent();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue