mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-25 06:45:31 +00:00
Capture ButtonUp events after ButtonDown even if the mouse leaves the window.
This commit is contained in:
parent
e8373def1b
commit
daf7c83dc8
|
@ -309,36 +309,45 @@ namespace OpenTK.Platform.Windows
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WindowMessage.LBUTTONDOWN:
|
case WindowMessage.LBUTTONDOWN:
|
||||||
|
Functions.SetCapture(window.WindowHandle);
|
||||||
mouse[MouseButton.Left] = true;
|
mouse[MouseButton.Left] = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WindowMessage.MBUTTONDOWN:
|
case WindowMessage.MBUTTONDOWN:
|
||||||
|
Functions.SetCapture(window.WindowHandle);
|
||||||
mouse[MouseButton.Middle] = true;
|
mouse[MouseButton.Middle] = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WindowMessage.RBUTTONDOWN:
|
case WindowMessage.RBUTTONDOWN:
|
||||||
|
Functions.SetCapture(window.WindowHandle);
|
||||||
mouse[MouseButton.Right] = true;
|
mouse[MouseButton.Right] = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WindowMessage.XBUTTONDOWN:
|
case WindowMessage.XBUTTONDOWN:
|
||||||
mouse[((wParam.ToInt32() & 0xFFFF0000) >> 16) != (int)MouseKeys.XButton1 ? MouseButton.Button1 : MouseButton.Button2] = true;
|
Functions.SetCapture(window.WindowHandle);
|
||||||
|
mouse[((wParam.ToInt32() & 0xFFFF0000) >> 16) !=
|
||||||
|
(int)MouseKeys.XButton1 ? MouseButton.Button1 : MouseButton.Button2] = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WindowMessage.LBUTTONUP:
|
case WindowMessage.LBUTTONUP:
|
||||||
|
Functions.ReleaseCapture();
|
||||||
mouse[MouseButton.Left] = false;
|
mouse[MouseButton.Left] = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WindowMessage.MBUTTONUP:
|
case WindowMessage.MBUTTONUP:
|
||||||
|
Functions.ReleaseCapture();
|
||||||
mouse[MouseButton.Middle] = false;
|
mouse[MouseButton.Middle] = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WindowMessage.RBUTTONUP:
|
case WindowMessage.RBUTTONUP:
|
||||||
|
Functions.ReleaseCapture();
|
||||||
mouse[MouseButton.Right] = false;
|
mouse[MouseButton.Right] = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WindowMessage.XBUTTONUP:
|
case WindowMessage.XBUTTONUP:
|
||||||
// TODO: Is this correct?
|
Functions.ReleaseCapture();
|
||||||
mouse[((wParam.ToInt32() & 0xFFFF0000) >> 16) != (int)MouseKeys.XButton1 ? MouseButton.Button1 : MouseButton.Button2] = false;
|
mouse[((wParam.ToInt32() & 0xFFFF0000) >> 16) !=
|
||||||
|
(int)MouseKeys.XButton1 ? MouseButton.Button1 : MouseButton.Button2] = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Keyboard events:
|
// Keyboard events:
|
||||||
|
|
Loading…
Reference in a new issue