From f68e4cd8ed9761aa44c80c495af681ae07a18ae2 Mon Sep 17 00:00:00 2001 From: Noel Berry Date: Fri, 29 Jul 2022 10:11:36 -0700 Subject: [PATCH] added `pressed()` check for Stick & Axis bindings Shorthand for checking the individual buttons in the stuck or axis --- include/blah/input.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/blah/input.h b/include/blah/input.h index f233203..c5b1afb 100644 --- a/include/blah/input.h +++ b/include/blah/input.h @@ -615,6 +615,9 @@ namespace Blah // updates the Binding void update(); + // checks if the axis was pressed this frame (ie. went from 0 to -1 or 1) + bool pressed() const { return negative.pressed() || positive.pressed(); } + // consumes the press buffer void consume_press(); @@ -677,6 +680,9 @@ namespace Blah // Updates the Binding void update(); + // checks if the stick was pressed this frame + bool pressed() const { return x.pressed() || y.pressed(); } + // Consumes the Press Buffer void consume_press();