Files
aee/source/core/jail/jinput.hpp
T

37 lines
1.0 KiB
C++

#pragma once
#include <SDL3/SDL.h>
#include <cstdint>
namespace Ji {
void disableKeyboard(Uint32 time);
// Bloqueja tot l'input cap al joc (Ji::keyPressed retorna false per a tot)
void setInputBlocked(bool blocked);
// Estableix l'estat d'una tecla virtual. Múltiples fonts (gamepad, remap)
// s'agrupen per OR. Ji::keyPressed retorna true si el teclat real O qualsevol
// font virtual està premuda.
enum class VirtualSource : std::uint8_t {
GAMEPAD = 0,
REMAP = 1,
COUNT = 2
};
void setVirtualKey(int scancode, VirtualSource source, bool pressed);
void update();
// Avança el buffer rotatori de cheats afegint `scancode` per detectar
// seqüències com "reviu", "alone", "obert". Usat pel Director quan rep
// un KEY_DOWN; el joc no l'ha de cridar directament.
void moveCheats(Uint8 scancode);
auto keyPressed(int key) -> bool;
auto cheatActivated(const char* cheat_code) -> bool;
auto anyKey() -> bool;
} // namespace Ji