diff options
author | wwylele <wwylele@gmail.com> | 2017-01-21 10:53:03 +0100 |
---|---|---|
committer | wwylele <wwylele@gmail.com> | 2017-03-01 22:30:57 +0100 |
commit | 38e800f70d122051e12ac9f22e23d84b97fec424 (patch) | |
tree | 0f52b5731a4fd8e9f2a39e8e75d1fa18ce8b9107 /src/citra/emu_window | |
parent | HID: use AnalogDevice (diff) | |
download | yuzu-38e800f70d122051e12ac9f22e23d84b97fec424.tar yuzu-38e800f70d122051e12ac9f22e23d84b97fec424.tar.gz yuzu-38e800f70d122051e12ac9f22e23d84b97fec424.tar.bz2 yuzu-38e800f70d122051e12ac9f22e23d84b97fec424.tar.lz yuzu-38e800f70d122051e12ac9f22e23d84b97fec424.tar.xz yuzu-38e800f70d122051e12ac9f22e23d84b97fec424.tar.zst yuzu-38e800f70d122051e12ac9f22e23d84b97fec424.zip |
Diffstat (limited to '')
-rw-r--r-- | src/citra/emu_window/emu_window_sdl2.cpp | 21 | ||||
-rw-r--r-- | src/citra/emu_window/emu_window_sdl2.h | 6 |
2 files changed, 6 insertions, 21 deletions
diff --git a/src/citra/emu_window/emu_window_sdl2.cpp b/src/citra/emu_window/emu_window_sdl2.cpp index 00d00905a..6bc0b0d00 100644 --- a/src/citra/emu_window/emu_window_sdl2.cpp +++ b/src/citra/emu_window/emu_window_sdl2.cpp @@ -12,9 +12,9 @@ #include "common/logging/log.h" #include "common/scm_rev.h" #include "common/string_util.h" -#include "core/frontend/key_map.h" -#include "core/hle/service/hid/hid.h" #include "core/settings.h" +#include "input_common/keyboard.h" +#include "input_common/main.h" #include "video_core/video_core.h" void EmuWindow_SDL2::OnMouseMotion(s32 x, s32 y) { @@ -40,9 +40,9 @@ void EmuWindow_SDL2::OnMouseButton(u32 button, u8 state, s32 x, s32 y) { void EmuWindow_SDL2::OnKeyEvent(int key, u8 state) { if (state == SDL_PRESSED) { - KeyMap::PressKey(*this, {key, keyboard_id}); + InputCommon::GetKeyboard()->PressKey(key); } else if (state == SDL_RELEASED) { - KeyMap::ReleaseKey(*this, {key, keyboard_id}); + InputCommon::GetKeyboard()->ReleaseKey(key); } } @@ -57,9 +57,8 @@ void EmuWindow_SDL2::OnResize() { } EmuWindow_SDL2::EmuWindow_SDL2() { - keyboard_id = KeyMap::NewDeviceId(); + InputCommon::Init(); - ReloadSetKeymaps(); motion_emu = std::make_unique<Motion::MotionEmu>(*this); SDL_SetMainReady(); @@ -117,6 +116,7 @@ EmuWindow_SDL2::~EmuWindow_SDL2() { SDL_GL_DeleteContext(gl_context); SDL_Quit(); motion_emu = nullptr; + InputCommon::Shutdown(); } void EmuWindow_SDL2::SwapBuffers() { @@ -169,15 +169,6 @@ void EmuWindow_SDL2::DoneCurrent() { SDL_GL_MakeCurrent(render_window, nullptr); } -void EmuWindow_SDL2::ReloadSetKeymaps() { - KeyMap::ClearKeyMapping(keyboard_id); - for (int i = 0; i < Settings::NativeInput::NUM_INPUTS; ++i) { - KeyMap::SetKeyMapping( - {Settings::values.input_mappings[Settings::NativeInput::All[i]], keyboard_id}, - KeyMap::mapping_targets[i]); - } -} - void EmuWindow_SDL2::OnMinimalClientAreaChangeRequest( const std::pair<unsigned, unsigned>& minimal_size) { diff --git a/src/citra/emu_window/emu_window_sdl2.h b/src/citra/emu_window/emu_window_sdl2.h index b1cbf16d7..1ce2991f7 100644 --- a/src/citra/emu_window/emu_window_sdl2.h +++ b/src/citra/emu_window/emu_window_sdl2.h @@ -31,9 +31,6 @@ public: /// Whether the window is still open, and a close request hasn't yet been sent bool IsOpen() const; - /// Load keymap from configuration - void ReloadSetKeymaps() override; - private: /// Called by PollEvents when a key is pressed or released. void OnKeyEvent(int key, u8 state); @@ -61,9 +58,6 @@ private: /// The OpenGL context associated with the window SDL_GLContext gl_context; - /// Device id of keyboard for use with KeyMap - int keyboard_id; - /// Motion sensors emulation std::unique_ptr<Motion::MotionEmu> motion_emu; }; |