From eaa926652139b5d3dca6cadbf2346047a50e1230 Mon Sep 17 00:00:00 2001 From: Evan Hemsley Date: Thu, 28 Dec 2023 18:54:21 -0800 Subject: [PATCH] remove Marshal call from KeyboardButton.CheckPressed --- src/Input/VirtualButtons/KeyboardButton.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Input/VirtualButtons/KeyboardButton.cs b/src/Input/VirtualButtons/KeyboardButton.cs index e9a1d158..85df8738 100644 --- a/src/Input/VirtualButtons/KeyboardButton.cs +++ b/src/Input/VirtualButtons/KeyboardButton.cs @@ -1,5 +1,3 @@ -using System.Runtime.InteropServices; - namespace MoonWorks.Input { /// @@ -16,9 +14,9 @@ namespace MoonWorks.Input KeyCode = keyCode; } - internal override bool CheckPressed() + internal unsafe override bool CheckPressed() { - return Conversions.ByteToBool(Marshal.ReadByte(Parent.State, (int) KeyCode)); + return Conversions.ByteToBool(((byte*) Parent.State)[(int) KeyCode]); } } }