From 39eb3b189242945e505a4036f9a9109a2755bbcf Mon Sep 17 00:00:00 2001 From: thefiddler Date: Sun, 4 May 2014 08:31:11 +0200 Subject: [PATCH] [Input] Improved MouseState.ToString() --- Source/OpenTK/Input/MouseScrollWheel.cs | 2 +- Source/OpenTK/Input/MouseState.cs | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Source/OpenTK/Input/MouseScrollWheel.cs b/Source/OpenTK/Input/MouseScrollWheel.cs index 69fd17f..2be06b6 100644 --- a/Source/OpenTK/Input/MouseScrollWheel.cs +++ b/Source/OpenTK/Input/MouseScrollWheel.cs @@ -72,7 +72,7 @@ namespace OpenTK.Input /// A that represents the current . public override string ToString() { - return string.Format("[MouseScrollWheel: X={0}, Y={1}]", X, Y); + return string.Format("[X={0:0.00}, Y={1:0.00}]", X, Y); } /// diff --git a/Source/OpenTK/Input/MouseState.cs b/Source/OpenTK/Input/MouseState.cs index 5b12fe2..557aa1c 100644 --- a/Source/OpenTK/Input/MouseState.cs +++ b/Source/OpenTK/Input/MouseState.cs @@ -257,6 +257,17 @@ namespace OpenTK.Input return buttons.GetHashCode() ^ X.GetHashCode() ^ Y.GetHashCode() ^ scroll.GetHashCode(); } + /// + /// Returns a that represents the current . + /// + /// A that represents the current . + public override string ToString() + { + string b = Convert.ToString(buttons, 2).PadLeft(10, '0'); + return String.Format("[MouseState: X={0}, Y={1}, Scroll={2}, Buttons={3}, IsConnected={4}]", + X, Y, Scroll, b, IsConnected); + } + #endregion #region Internal Members -- 2.7.4