summaryrefslogtreecommitdiff
path: root/src/citra_qt/bootmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/citra_qt/bootmanager.cpp')
-rw-r--r--src/citra_qt/bootmanager.cpp26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp
index 69d18cf0c..28264df9a 100644
--- a/src/citra_qt/bootmanager.cpp
+++ b/src/citra_qt/bootmanager.cpp
@@ -13,7 +13,9 @@
13#include "common/scm_rev.h" 13#include "common/scm_rev.h"
14#include "common/string_util.h" 14#include "common/string_util.h"
15#include "core/core.h" 15#include "core/core.h"
16#include "core/frontend/key_map.h" 16#include "core/settings.h"
17#include "input_common/keyboard.h"
18#include "input_common/main.h"
17#include "video_core/debug_utils/debug_utils.h" 19#include "video_core/debug_utils/debug_utils.h"
18#include "video_core/video_core.h" 20#include "video_core/video_core.h"
19 21
@@ -99,14 +101,17 @@ private:
99}; 101};
100 102
101GRenderWindow::GRenderWindow(QWidget* parent, EmuThread* emu_thread) 103GRenderWindow::GRenderWindow(QWidget* parent, EmuThread* emu_thread)
102 : QWidget(parent), child(nullptr), keyboard_id(0), emu_thread(emu_thread) { 104 : QWidget(parent), child(nullptr), emu_thread(emu_thread) {
103 105
104 std::string window_title = Common::StringFromFormat("Citra %s| %s-%s", Common::g_build_name, 106 std::string window_title = Common::StringFromFormat("Citra %s| %s-%s", Common::g_build_name,
105 Common::g_scm_branch, Common::g_scm_desc); 107 Common::g_scm_branch, Common::g_scm_desc);
106 setWindowTitle(QString::fromStdString(window_title)); 108 setWindowTitle(QString::fromStdString(window_title));
107 109
108 keyboard_id = KeyMap::NewDeviceId(); 110 InputCommon::Init();
109 ReloadSetKeymaps(); 111}
112
113GRenderWindow::~GRenderWindow() {
114 InputCommon::Shutdown();
110} 115}
111 116
112void GRenderWindow::moveContext() { 117void GRenderWindow::moveContext() {
@@ -197,11 +202,11 @@ void GRenderWindow::closeEvent(QCloseEvent* event) {
197} 202}
198 203
199void GRenderWindow::keyPressEvent(QKeyEvent* event) { 204void GRenderWindow::keyPressEvent(QKeyEvent* event) {
200 KeyMap::PressKey(*this, {event->key(), keyboard_id}); 205 InputCommon::GetKeyboard()->PressKey(event->key());
201} 206}
202 207
203void GRenderWindow::keyReleaseEvent(QKeyEvent* event) { 208void GRenderWindow::keyReleaseEvent(QKeyEvent* event) {
204 KeyMap::ReleaseKey(*this, {event->key(), keyboard_id}); 209 InputCommon::GetKeyboard()->ReleaseKey(event->key());
205} 210}
206 211
207void GRenderWindow::mousePressEvent(QMouseEvent* event) { 212void GRenderWindow::mousePressEvent(QMouseEvent* event) {
@@ -230,14 +235,7 @@ void GRenderWindow::mouseReleaseEvent(QMouseEvent* event) {
230 motion_emu->EndTilt(); 235 motion_emu->EndTilt();
231} 236}
232 237
233void GRenderWindow::ReloadSetKeymaps() { 238void GRenderWindow::ReloadSetKeymaps() {}
234 KeyMap::ClearKeyMapping(keyboard_id);
235 for (int i = 0; i < Settings::NativeInput::NUM_INPUTS; ++i) {
236 KeyMap::SetKeyMapping(
237 {Settings::values.input_mappings[Settings::NativeInput::All[i]], keyboard_id},
238 KeyMap::mapping_targets[i]);
239 }
240}
241 239
242void GRenderWindow::OnClientAreaResized(unsigned width, unsigned height) { 240void GRenderWindow::OnClientAreaResized(unsigned width, unsigned height) {
243 NotifyClientAreaSizeChanged(std::make_pair(width, height)); 241 NotifyClientAreaSizeChanged(std::make_pair(width, height));