diff --git a/source/ps/Hotkey.cpp b/source/ps/Hotkey.cpp index 633e61d9ba..55203ecdbd 100644 --- a/source/ps/Hotkey.cpp +++ b/source/ps/Hotkey.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2023 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -71,7 +71,6 @@ namespace { static_assert(std::is_integral::type>::value, "SDL_Scancode is not an integral enum."); static_assert(SDL_USEREVENT_ == SDL_USEREVENT, "SDL_USEREVENT_ is not the same type as the real SDL_USEREVENT"); -static_assert(UNUSED_HOTKEY_CODE == SDL_SCANCODE_UNKNOWN); // Look up each key binding in the config file and set the mappings for // all key combinations that trigger it. diff --git a/source/ps/Hotkey.h b/source/ps/Hotkey.h index 5bcfaa19ad..46596afc47 100644 --- a/source/ps/Hotkey.h +++ b/source/ps/Hotkey.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2023 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -49,7 +49,8 @@ const uint SDL_HOTKEYUP = SDL_USEREVENT_ + 2; const uint SDL_HOTKEYPRESS_SILENT = SDL_USEREVENT_ + 3; const uint SDL_HOTKEYUP_SILENT = SDL_USEREVENT_ + 4; -constexpr SDL_Scancode_ UNUSED_HOTKEY_CODE = 0; // == SDL_SCANCODE_UNKNOWN +// Value not mapping to any valid SDL_SCANCODE_* +constexpr SDL_Scancode_ UNUSED_HOTKEY_CODE{-1}; struct SKey {