From 9f623b249f212dc5153660c39ddee993ccc9e9d3 Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Thu, 12 Oct 2023 17:07:59 +0200 Subject: [PATCH] - [NEW] input::anyKeyPressed() --- source/jinput.cpp | 5 +++++ source/jinput.h | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/source/jinput.cpp b/source/jinput.cpp index e829b50..24f6c01 100644 --- a/source/jinput.cpp +++ b/source/jinput.cpp @@ -35,6 +35,11 @@ namespace input return keydown != 0; } + bool anyKeyPressed() + { + return keypressed != 0; + } + // Torna el codi de la tecla que està sent polsada ara mateix const uint8_t whichKey() { diff --git a/source/jinput.h b/source/jinput.h index d3a1968..5c43118 100644 --- a/source/jinput.h +++ b/source/jinput.h @@ -21,6 +21,10 @@ namespace input /// @return true si hi ha alguna tecla polsada, false si no bool anyKey(); + /// @brief El equivalent a anykey per a keypressed + /// @return true si hi ha alguna tecla polsada, false si no + bool anyKeyPressed(); + /// @brief Torna el codi de la tecla que està sent polsada ara mateix /// @return Quina tecla està sent polsada const uint8_t whichKey();