#include <input_manager.h>

Public Member Functions | |
| InputManager () | |
| ~InputManager () | |
| bool | Initialize (InputBackendFactory::BackendType type=InputBackendFactory::BackendType::SDL2) |
| void | Initialize (std::unique_ptr< IInputBackend > backend) |
| void | Shutdown () |
| void | Poll (Snes *snes, int player=1) |
| void | ProcessEvent (void *event) |
| IInputBackend * | backend () |
| const IInputBackend * | backend () const |
| bool | IsInitialized () const |
| InputConfig | GetConfig () const |
| void | SetConfig (const InputConfig &config) |
| void | PressButton (SnesButton button) |
| void | ReleaseButton (SnesButton button) |
Private Attributes | |
| std::unique_ptr< IInputBackend > | backend_ |
| std::atomic< uint16_t > | agent_buttons_ {0} |
| InputConfig | config_ |
Definition at line 17 of file input_manager.h.
| yaze::emu::input::InputManager::InputManager | ( | ) |
Definition at line 10 of file input_manager.cc.
References yaze::emu::input::ApplyDefaultKeyBindings(), config_, yaze::emu::input::InputConfig::continuous_polling, yaze::emu::input::InputConfig::enable_gamepad, and yaze::emu::input::InputConfig::gamepad_index.

|
inline |
Definition at line 20 of file input_manager.h.
References Shutdown().

| bool yaze::emu::input::InputManager::Initialize | ( | InputBackendFactory::BackendType | type = InputBackendFactory::BackendType::SDL2 | ) |
Definition at line 17 of file input_manager.cc.
References yaze::emu::input::ApplyDefaultKeyBindings(), backend_, config_, yaze::emu::input::InputBackendFactory::Create(), LOG_ERROR, and LOG_INFO.
Referenced by main(), and yaze::emu::Emulator::Run().

| void yaze::emu::input::InputManager::Initialize | ( | std::unique_ptr< IInputBackend > | backend | ) |
Definition at line 38 of file input_manager.cc.
References yaze::emu::input::ApplyDefaultKeyBindings(), backend(), backend_, config_, and LOG_INFO.

| void yaze::emu::input::InputManager::Shutdown | ( | ) |
| void yaze::emu::input::InputManager::Poll | ( | Snes * | snes, |
| int | player = 1 ) |
Definition at line 59 of file input_manager.cc.
References agent_buttons_, backend_, yaze::emu::input::ControllerState::buttons, LOG_INFO, and yaze::emu::Snes::SetButtonState().
Referenced by main(), and yaze::emu::Emulator::Run().

| void yaze::emu::input::InputManager::ProcessEvent | ( | void * | event | ) |
Definition at line 87 of file input_manager.cc.
References backend_.
|
inline |
Definition at line 29 of file input_manager.h.
References backend_.
Referenced by Initialize(), yaze::emu::ui::RenderKeyboardConfig(), and yaze::emu::Emulator::Run().
|
inline |
Definition at line 30 of file input_manager.h.
References backend_.
|
inline |
Definition at line 32 of file input_manager.h.
References backend_.
Referenced by yaze::emu::Emulator::Run().
| InputConfig yaze::emu::input::InputManager::GetConfig | ( | ) | const |
Definition at line 93 of file input_manager.cc.
References backend_, and config_.
Referenced by yaze::emu::ui::RenderKeyboardConfig(), yaze::emu::ui::RenderNavBar(), and yaze::emu::Emulator::Run().
| void yaze::emu::input::InputManager::SetConfig | ( | const InputConfig & | config | ) |
Definition at line 100 of file input_manager.cc.
References yaze::emu::input::ApplyDefaultKeyBindings(), backend_, config_, yaze::emu::input::InputConfig::continuous_polling, yaze::emu::input::InputConfig::ignore_imgui_text_input, and LOG_WARN.
Referenced by yaze::emu::ui::RenderKeyboardConfig(), yaze::emu::Emulator::Run(), and yaze::emu::Emulator::SetInputConfig().

| void yaze::emu::input::InputManager::PressButton | ( | SnesButton | button | ) |
Definition at line 121 of file input_manager.cc.
References agent_buttons_.
Referenced by yaze::net::EmulatorServiceImpl::HoldButtons(), and yaze::net::EmulatorServiceImpl::PressButtons().
| void yaze::emu::input::InputManager::ReleaseButton | ( | SnesButton | button | ) |
Definition at line 127 of file input_manager.cc.
References agent_buttons_.
Referenced by yaze::net::EmulatorServiceImpl::ReleaseButtons().
|
private |
Definition at line 42 of file input_manager.h.
Referenced by backend(), backend(), GetConfig(), Initialize(), Initialize(), IsInitialized(), Poll(), ProcessEvent(), SetConfig(), and Shutdown().
|
private |
Definition at line 43 of file input_manager.h.
Referenced by Poll(), PressButton(), and ReleaseButton().
|
private |
Definition at line 44 of file input_manager.h.
Referenced by GetConfig(), Initialize(), Initialize(), InputManager(), and SetConfig().