5 namespace rolmodl::kb {
7 void Name::query(
const Key k) noexcept {
8 instance().data_ = SDL_GetKeyName(key::unsafe::toSDLEnum(k));
10 const char* Name::lastQueryRes() noexcept {
11 return instance().data_;
14 Name& Name::instance() noexcept {
24 bool State::down(
const Scancode s) {
25 const unsigned int i = scancode::unsafe::toSDLEnum(s);
28 return static_cast<bool>(unsafeRaw()[i]);
30 bool State::up(
const Scancode s) {
34 bool State::down(
const Key k) {
35 return down(key::scancode(k));
37 bool State::up(
const Key k) {
41 State& State::instance() noexcept {
46 const uint8_t* State::unsafeRaw() noexcept {
47 return instance().data_;
49 unsigned int State::unsafeRawL() noexcept {
58 data_ = SDL_GetKeyboardState(&tmp);
59 l_ = static_cast<unsigned int>(tmp);