Aegis2D
Modular C++26 2D game engine for networked games
Loading...
Searching...
No Matches
keyboard.hpp File Reference

Keyboard keys, their names, and the state of the keyboard during a frame. More...

#include <aegis2d/platform/export.hpp>
#include <array>
#include <bitset>
#include <cstddef>
#include <cstdint>
#include <optional>
#include <span>
#include <string>
#include <string_view>

Go to the source code of this file.

Classes

class  aegis2d::platform::Keyboard
 Keys held down, and those pressed or released since the start of the frame. More...
 

Namespaces

namespace  aegis2d
 Root namespace of the engine.
 
namespace  aegis2d::platform
 Window and input on top of SDL3, independent of the graphics API (client only).
 

Enumerations

enum class  aegis2d::platform::Key : std::uint8_t {
  aegis2d::platform::A , aegis2d::platform::B , aegis2d::platform::C , aegis2d::platform::D ,
  aegis2d::platform::E , aegis2d::platform::F , aegis2d::platform::G , aegis2d::platform::H ,
  aegis2d::platform::I , aegis2d::platform::J , aegis2d::platform::K , aegis2d::platform::L ,
  aegis2d::platform::M , aegis2d::platform::N , aegis2d::platform::O , aegis2d::platform::P ,
  aegis2d::platform::Q , aegis2d::platform::R , aegis2d::platform::S , aegis2d::platform::T ,
  aegis2d::platform::U , aegis2d::platform::V , aegis2d::platform::W , aegis2d::platform::X ,
  aegis2d::platform::Y , aegis2d::platform::Z , aegis2d::platform::Num0 , aegis2d::platform::Num1 ,
  aegis2d::platform::Num2 , aegis2d::platform::Num3 , aegis2d::platform::Num4 , aegis2d::platform::Num5 ,
  aegis2d::platform::Num6 , aegis2d::platform::Num7 , aegis2d::platform::Num8 , aegis2d::platform::Num9 ,
  aegis2d::platform::F1 , aegis2d::platform::F2 , aegis2d::platform::F3 , aegis2d::platform::F4 ,
  aegis2d::platform::F5 , aegis2d::platform::F6 , aegis2d::platform::F7 , aegis2d::platform::F8 ,
  aegis2d::platform::F9 , aegis2d::platform::F10 , aegis2d::platform::F11 , aegis2d::platform::F12 ,
  aegis2d::platform::Up , aegis2d::platform::Down , aegis2d::platform::Left , aegis2d::platform::Right ,
  aegis2d::platform::Space , aegis2d::platform::Enter , aegis2d::platform::Escape , aegis2d::platform::Tab ,
  aegis2d::platform::Backspace , aegis2d::platform::Insert , aegis2d::platform::Delete , aegis2d::platform::Home ,
  aegis2d::platform::End , aegis2d::platform::PageUp , aegis2d::platform::PageDown , aegis2d::platform::LeftShift ,
  aegis2d::platform::RightShift , aegis2d::platform::LeftCtrl , aegis2d::platform::RightCtrl , aegis2d::platform::LeftAlt ,
  aegis2d::platform::RightAlt , aegis2d::platform::CapsLock , aegis2d::platform::Minus , aegis2d::platform::Equals ,
  aegis2d::platform::LeftBracket , aegis2d::platform::RightBracket , aegis2d::platform::Backslash , aegis2d::platform::Semicolon ,
  aegis2d::platform::Apostrophe , aegis2d::platform::Grave , aegis2d::platform::Comma , aegis2d::platform::Period ,
  aegis2d::platform::Slash , aegis2d::platform::Keypad0 , aegis2d::platform::Keypad1 , aegis2d::platform::Keypad2 ,
  aegis2d::platform::Keypad3 , aegis2d::platform::Keypad4 , aegis2d::platform::Keypad5 , aegis2d::platform::Keypad6 ,
  aegis2d::platform::Keypad7 , aegis2d::platform::Keypad8 , aegis2d::platform::Keypad9 , aegis2d::platform::KeypadPeriod ,
  aegis2d::platform::KeypadDivide , aegis2d::platform::KeypadMultiply , aegis2d::platform::KeypadMinus , aegis2d::platform::KeypadPlus ,
  aegis2d::platform::KeypadEnter
}
 Keyboard key, independent of SDL. More...
 

Functions

std::string_view aegis2d::platform::key_name (Key key) noexcept
 Stable name of a key, as written in settings files.
 
std::optional< Key > aegis2d::platform::key_from_name (std::string_view name)
 Key whose name is name, ignoring case.
 
std::string aegis2d::platform::key_label (Key key)
 Name of a key as shown to the player, such as in a controls reminder.
 

Variables

constexpr std::size_t aegis2d::platform::key_count = static_cast<std::size_t>(Key::KeypadEnter) + 1
 Number of keys in Key, to size per-key tables.
 

Detailed Description

Keyboard keys, their names, and the state of the keyboard during a frame.