#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_ |
| ControllerState | agent_controller_state_ |
| InputConfig | config_ |
Definition at line 16 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 19 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_controller_state_, 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 86 of file input_manager.cc.
References backend_.
|
inline |
Definition at line 28 of file input_manager.h.
References backend_.
Referenced by Initialize(), yaze::emu::ui::RenderKeyboardConfig(), and yaze::emu::Emulator::Run().
|
inline |
Definition at line 29 of file input_manager.h.
References backend_.
|
inline |
Definition at line 31 of file input_manager.h.
References backend_.
Referenced by yaze::emu::Emulator::Run().
| InputConfig yaze::emu::input::InputManager::GetConfig | ( | ) | const |
Definition at line 92 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 99 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 120 of file input_manager.cc.
References agent_controller_state_, and yaze::emu::input::ControllerState::SetButton().
Referenced by yaze::agent::EmulatorServiceImpl::HoldButtons(), and yaze::agent::EmulatorServiceImpl::PressButtons().

| void yaze::emu::input::InputManager::ReleaseButton | ( | SnesButton | button | ) |
Definition at line 124 of file input_manager.cc.
References agent_controller_state_, and yaze::emu::input::ControllerState::SetButton().
Referenced by yaze::agent::EmulatorServiceImpl::ReleaseButtons().

|
private |
Definition at line 41 of file input_manager.h.
Referenced by backend(), backend(), GetConfig(), Initialize(), Initialize(), IsInitialized(), Poll(), ProcessEvent(), SetConfig(), and Shutdown().
|
private |
Definition at line 42 of file input_manager.h.
Referenced by Poll(), PressButton(), and ReleaseButton().
|
private |
Definition at line 43 of file input_manager.h.
Referenced by GetConfig(), Initialize(), Initialize(), InputManager(), and SetConfig().