diff --git a/CSFML/include/SFML/Window/Event.h b/CSFML/include/SFML/Window/Event.h
index 3471ccaf7..c14846971 100644
--- a/CSFML/include/SFML/Window/Event.h
+++ b/CSFML/include/SFML/Window/Event.h
@@ -242,6 +242,8 @@ struct sfMouseWheelEvent
{
sfEventType Type;
int Delta;
+ int X;
+ int Y;
};
////////////////////////////////////////////////////////////
diff --git a/CSFML/src/SFML/ConvertEvent.h b/CSFML/src/SFML/ConvertEvent.h
index acfb6812a..06a222d88 100644
--- a/CSFML/src/SFML/ConvertEvent.h
+++ b/CSFML/src/SFML/ConvertEvent.h
@@ -62,6 +62,8 @@ inline void ConvertEvent(const sf::Event& SFMLEvent, sfEvent* event)
case sfEvtMouseWheelMoved :
event->MouseWheel.Delta = SFMLEvent.MouseWheel.Delta;
+ event->MouseWheel.X = SFMLEvent.MouseWheel.X;
+ event->MouseWheel.Y = SFMLEvent.MouseWheel.Y;
break;
case sfEvtMouseButtonPressed :
diff --git a/dotnet/extlibs/csfml-audio.dll b/dotnet/extlibs/csfml-audio.dll
index 502ce538c..64dadbf25 100644
Binary files a/dotnet/extlibs/csfml-audio.dll and b/dotnet/extlibs/csfml-audio.dll differ
diff --git a/dotnet/extlibs/csfml-graphics.dll b/dotnet/extlibs/csfml-graphics.dll
index c3b9d894e..7754a788b 100644
Binary files a/dotnet/extlibs/csfml-graphics.dll and b/dotnet/extlibs/csfml-graphics.dll differ
diff --git a/dotnet/extlibs/csfml-window.dll b/dotnet/extlibs/csfml-window.dll
index b7331f213..5f763d174 100644
Binary files a/dotnet/extlibs/csfml-window.dll and b/dotnet/extlibs/csfml-window.dll differ
diff --git a/dotnet/src/Window/Event.cs b/dotnet/src/Window/Event.cs
index 543ada661..08374c409 100644
--- a/dotnet/src/Window/Event.cs
+++ b/dotnet/src/Window/Event.cs
@@ -294,6 +294,12 @@ namespace SFML
{
/// Scroll amount
public int Delta;
+
+ /// X coordinate of the mouse cursor
+ public int X;
+
+ /// Y coordinate of the mouse cursor
+ public int Y;
}
////////////////////////////////////////////////////////////
diff --git a/dotnet/src/Window/EventArgs.cs b/dotnet/src/Window/EventArgs.cs
index d66e569c1..acbd040cf 100644
--- a/dotnet/src/Window/EventArgs.cs
+++ b/dotnet/src/Window/EventArgs.cs
@@ -132,10 +132,18 @@ namespace SFML
public MouseWheelEventArgs(MouseWheelEvent e)
{
Delta = e.Delta;
+ X = e.X;
+ Y = e.Y;
}
/// Scroll amount
public int Delta;
+
+ /// X coordinate of the mouse cursor
+ public int X;
+
+ /// Y coordinate of the mouse cursor
+ public int Y;
}
////////////////////////////////////////////////////////////
diff --git a/include/SFML/Window/Event.hpp b/include/SFML/Window/Event.hpp
index ad7af14ff..f241b282a 100644
--- a/include/SFML/Window/Event.hpp
+++ b/include/SFML/Window/Event.hpp
@@ -223,8 +223,8 @@ public :
////////////////////////////////////////////////////////////
struct MouseMoveEvent
{
- int X; ///< X position of the mouse, relative to the left of the owner window
- int Y; ///< Y position of the mouse, relative to the top of the owner window
+ int X; ///< X position of the mouse pointer, relative to the left of the owner window
+ int Y; ///< Y position of the mouse pointer, relative to the top of the owner window
};
////////////////////////////////////////////////////////////
@@ -235,8 +235,8 @@ public :
struct MouseButtonEvent
{
Mouse::Button Button; ///< Code of the button that has been pressed
- int X; ///< X position of the mouse, relative to the left of the owner window
- int Y; ///< Y position of the mouse, relative to the top of the owner window
+ int X; ///< X position of the mouse pointer, relative to the left of the owner window
+ int Y; ///< Y position of the mouse pointer, relative to the top of the owner window
};
////////////////////////////////////////////////////////////
@@ -246,6 +246,8 @@ public :
struct MouseWheelEvent
{
int Delta; ///< Number of ticks the wheel has moved (positive is up, negative is down)
+ int X; ///< X position of the mouse pointer, relative to the left of the owner window
+ int Y; ///< Y position of the mouse pointer, relative to the top of the owner window
};
////////////////////////////////////////////////////////////
diff --git a/src/SFML/Window/Win32/WindowImplWin32.cpp b/src/SFML/Window/Win32/WindowImplWin32.cpp
index 01a0bf483..246b4f1fd 100644
--- a/src/SFML/Window/Win32/WindowImplWin32.cpp
+++ b/src/SFML/Window/Win32/WindowImplWin32.cpp
@@ -532,9 +532,17 @@ void WindowImplWin32::ProcessEvent(UINT message, WPARAM wParam, LPARAM lParam)
// Mouse wheel event
case WM_MOUSEWHEEL :
{
+ // Mouse position is in screen coordinates, convert it to window coordinates
+ POINT position;
+ position.x = LOWORD(lParam);
+ position.y = HIWORD(lParam);
+ ScreenToClient(myHandle, &position);
+
Event event;
event.Type = Event::MouseWheelMoved;
event.MouseWheel.Delta = static_cast(HIWORD(wParam)) / 120;
+ event.MouseButton.X = position.x;
+ event.MouseButton.Y = position.y;
SendEvent(event);
break;
}