From d5ddd44bd3783c6b264f219889aafa412f4549a6 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Mon, 28 Nov 2022 00:48:48 -0800 Subject: [PATCH] add IsIdle and IsUp to VirtualButton --- src/Input/VirtualButton.cs | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/Input/VirtualButton.cs b/src/Input/VirtualButton.cs index 4f9efc2..2e0afe9 100644 --- a/src/Input/VirtualButton.cs +++ b/src/Input/VirtualButton.cs @@ -5,9 +5,9 @@ namespace MoonWorks.Input public ButtonState State { get; protected set; } /// - /// True if the button is pressed or held. + /// True if the button was pressed this exact frame. /// - public bool IsDown => State.IsDown; + public bool IsPressed => State.IsPressed; /// /// True if the button has been continuously held for more than one frame. @@ -15,15 +15,25 @@ namespace MoonWorks.Input public bool IsHeld => State.IsHeld; /// - /// True if the button was pressed this exact frame. + /// True if the button is pressed or held. /// - public bool IsPressed => State.IsPressed; + public bool IsDown => State.IsDown; /// - /// True if the button is not pressed. + /// True if the button was released this frame. /// public bool IsReleased => State.IsReleased; + /// + /// True if the button was not pressed the previous or current frame. + /// + public bool IsIdle => State.IsIdle; + + /// + /// True if the button is idle or released. + /// + public bool IsUp => State.IsUp; + internal virtual void Update() { State = State.Update(CheckPressed());