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();