diff --git a/Source/OpenTK/Platform/Windows/API.cs b/Source/OpenTK/Platform/Windows/API.cs
index 22b77b78..7ca2f5b8 100644
--- a/Source/OpenTK/Platform/Windows/API.cs
+++ b/Source/OpenTK/Platform/Windows/API.cs
@@ -978,12 +978,6 @@ namespace OpenTK.Platform.Windows
public struct Constants
{
- // Mouse indicator flags (found in winuser.h)
- public const int MOUSE_MOVE_RELATIVE = 0;
- public const int MOUSE_MOVE_ABSOLUTE = 1;
- public const int MOUSE_VIRTUAL_DESKTOP = 0x02; // the coordinates are mapped to the virtual desktop
- public const int MOUSE_ATTRIBUTES_CHANGED = 0x04; // requery for mouse attributes
-
// Found in winuser.h
public const int KEYBOARD_OVERRUN_MAKE_CODE = 0xFF;
@@ -1650,17 +1644,17 @@ namespace OpenTK.Platform.Windows
{
public RawInputHeader Header;
public RawInputData Data;
+ }
- [StructLayout(LayoutKind.Explicit)]
- public struct RawInputData
- {
- [FieldOffset(0)]
- public RawMouse Mouse;
- [FieldOffset(0)]
- public RawKeyboard Keyboard;
- [FieldOffset(0)]
- public RawHID HID;
- }
+ [StructLayout(LayoutKind.Explicit)]
+ public struct RawInputData
+ {
+ [FieldOffset(0)]
+ public RawMouse Mouse;
+ [FieldOffset(0)]
+ public RawKeyboard Keyboard;
+ [FieldOffset(0)]
+ public RawHID HID;
}
#endregion
@@ -1747,7 +1741,7 @@ namespace OpenTK.Platform.Windows
///
/// Contains information about the state of the mouse.
///
- [StructLayout(LayoutKind.Explicit)]
+ [StructLayout(LayoutKind.Sequential)]
public struct RawMouse
{
///
@@ -1761,45 +1755,44 @@ namespace OpenTK.Platform.Windows
/// MOUSE_VIRTUAL_DESKTOP
/// Mouse coordinates are mapped to the virtual desktop (for a multiple monitor system).
///
- [FieldOffset(0)]
- //public USHORT Flags;
- public SHORT Flags;
- ///
- /// Reserved.
- ///
- [FieldOffset(2)]
- ULONG Buttons;
+ //[FieldOffset(0)]
+ public RawMouseFlags Flags; // USHORT
+ // ///
+ // /// Reserved.
+ // ///
+ // [FieldOffset(2)]
+ // ULONG Buttons;
///
/// Transition state of the mouse buttons.
///
- [FieldOffset(2)]
+ //[FieldOffset(2)]
public RawInputMouseState ButtonFlags;
///
/// If usButtonFlags is RI_MOUSE_WHEEL, this member is a signed value that specifies the wheel delta.
///
- [FieldOffset(4)]
+ //[FieldOffset(4)]
//public USHORT ButtonData;
public SHORT ButtonData;
///
/// Raw state of the mouse buttons.
///
- [FieldOffset(6)]
+ //[FieldOffset(6)]
//public ULONG RawButtons;
public LONG RawButtons;
///
/// Motion in the X direction. This is signed relative motion or absolute motion, depending on the value of usFlags.
///
- [FieldOffset(10)]
+ //[FieldOffset(10)]
public LONG LastX;
///
/// Motion in the Y direction. This is signed relative motion or absolute motion, depending on the value of usFlags.
///
- [FieldOffset(14)]
+ //[FieldOffset(14)]
public LONG LastY;
///
/// Device-specific additional information for the event.
///
- [FieldOffset(18)]
+ //[FieldOffset(18)]
//public ULONG ExtraInformation;
public LONG ExtraInformation;
}
@@ -2044,6 +2037,8 @@ namespace OpenTK.Platform.Windows
#region --- Enums ---
+ #region public enum WindowStyle : int
+
public enum WindowStyle : int
{
Overlapped = 0x00000000,
@@ -2079,6 +2074,10 @@ namespace OpenTK.Platform.Windows
ChildWindow = Child
}
+ #endregion
+
+ #region public enum ExtendedWindowStyle : int
+
[Flags]
public enum ExtendedWindowStyle : int
{
@@ -2130,6 +2129,8 @@ namespace OpenTK.Platform.Windows
// #endif /* _WIN32_WINNT >= 0x0500 */
}
+ #endregion
+
#region GetWindowLongOffsets enum
public enum GetWindowLongOffsets : int
@@ -2350,6 +2351,34 @@ namespace OpenTK.Platform.Windows
#endregion
+ #region RawMouseFlags
+
+ ///
+ /// Mouse indicator flags (found in winuser.h).
+ ///
+ public enum RawMouseFlags : short
+ {
+ ///
+ /// LastX/Y indicate relative motion.
+ ///
+ MOUSE_MOVE_RELATIVE = 0x00,
+ ///
+ /// LastX/Y indicate absolute motion.
+ ///
+ MOUSE_MOVE_ABSOLUTE = 0x01,
+ ///
+ /// The coordinates are mapped to the virtual desktop.
+ ///
+ MOUSE_VIRTUAL_DESKTOP = 0x02,
+ ///
+ /// Requery for mouse attributes.
+ ///
+ MOUSE_ATTRIBUTES_CHANGED = 0x04,
+ }
+
+ #endregion
+
+
#region VirtualKeys
public enum VirtualKeys : short