From 82ee0f79acf3a528cde579210ed39875908b856b Mon Sep 17 00:00:00 2001 From: kimci86 Date: Tue, 19 Dec 2023 07:27:41 +0100 Subject: [PATCH] Remove Key::Last and Scan::Last enumerators The purpose of those was to make it obvious that an action is needed to update KeyCount or ScancodeCount when adding more enumerators, but we rarely touch those enumerations so it is not worth adding those technical names to the public API. --- include/SFML/Window/Keyboard.hpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/include/SFML/Window/Keyboard.hpp b/include/SFML/Window/Keyboard.hpp index 98afc3f16..38f599aa0 100644 --- a/include/SFML/Window/Keyboard.hpp +++ b/include/SFML/Window/Keyboard.hpp @@ -152,8 +152,6 @@ enum Key F14, //!< The F14 key F15, //!< The F15 key Pause, //!< The Pause key - - Last = Pause, //!< Keep equal to last enumerator -- used to define KeyCount }; //////////////////////////////////////////////////////////// @@ -161,7 +159,7 @@ enum Key /// //////////////////////////////////////////////////////////// // NOLINTNEXTLINE(readability-identifier-naming) -static constexpr unsigned int KeyCount{static_cast(Key::Last) + 1}; +static constexpr unsigned int KeyCount{static_cast(Key::Pause) + 1}; //////////////////////////////////////////////////////////// /// \brief Scancodes @@ -326,8 +324,6 @@ enum class Scan LaunchApplication2, //!< Keyboard Launch Application 2 key LaunchMail, //!< Keyboard Launch Mail key LaunchMediaSelect, //!< Keyboard Launch Media Select key - - Last = LaunchMediaSelect, //!< Keep equal to last enumerator -- used to define ScancodeCount }; using Scancode = Scan; @@ -337,7 +333,7 @@ using Scancode = Scan; /// //////////////////////////////////////////////////////////// // NOLINTNEXTLINE(readability-identifier-naming) -static constexpr unsigned int ScancodeCount{static_cast(Scan::Last) + 1}; +static constexpr unsigned int ScancodeCount{static_cast(Scan::LaunchMediaSelect) + 1}; //////////////////////////////////////////////////////////// /// \brief Check if a key is pressed