diff options
author | wwylele <wwylele@gmail.com> | 2016-05-12 12:09:36 +0200 |
---|---|---|
committer | wwylele <wwylele@gmail.com> | 2016-05-15 12:24:22 +0200 |
commit | 03631f9b8fe75cf1c3a70a3094aeddcebffa4cf9 (patch) | |
tree | 95edc62b3b8520a533e534bf4991159875fef3e5 /src/citra | |
parent | AudioCore: Implement time stretcher (#1737) (diff) | |
download | yuzu-03631f9b8fe75cf1c3a70a3094aeddcebffa4cf9.tar yuzu-03631f9b8fe75cf1c3a70a3094aeddcebffa4cf9.tar.gz yuzu-03631f9b8fe75cf1c3a70a3094aeddcebffa4cf9.tar.bz2 yuzu-03631f9b8fe75cf1c3a70a3094aeddcebffa4cf9.tar.lz yuzu-03631f9b8fe75cf1c3a70a3094aeddcebffa4cf9.tar.xz yuzu-03631f9b8fe75cf1c3a70a3094aeddcebffa4cf9.tar.zst yuzu-03631f9b8fe75cf1c3a70a3094aeddcebffa4cf9.zip |
Diffstat (limited to '')
-rw-r--r-- | src/citra/config.cpp | 5 | ||||
-rw-r--r-- | src/citra/default_ini.h | 8 | ||||
-rw-r--r-- | src/citra/emu_window/emu_window_sdl2.cpp | 7 | ||||
-rw-r--r-- | src/citra_qt/bootmanager.cpp | 7 | ||||
-rw-r--r-- | src/citra_qt/config.cpp | 5 |
5 files changed, 20 insertions, 12 deletions
diff --git a/src/citra/config.cpp b/src/citra/config.cpp index c5cb4fb38..4f6d0a464 100644 --- a/src/citra/config.cpp +++ b/src/citra/config.cpp @@ -44,12 +44,15 @@ bool Config::LoadINI(const std::string& default_contents, bool retry) { } static const std::array<int, Settings::NativeInput::NUM_INPUTS> defaults = { + // directly mapped keys SDL_SCANCODE_A, SDL_SCANCODE_S, SDL_SCANCODE_Z, SDL_SCANCODE_X, SDL_SCANCODE_Q, SDL_SCANCODE_W, SDL_SCANCODE_1, SDL_SCANCODE_2, SDL_SCANCODE_M, SDL_SCANCODE_N, SDL_SCANCODE_B, SDL_SCANCODE_T, SDL_SCANCODE_G, SDL_SCANCODE_F, SDL_SCANCODE_H, + SDL_SCANCODE_I, SDL_SCANCODE_K, SDL_SCANCODE_J, SDL_SCANCODE_L, + + // indirectly mapped keys SDL_SCANCODE_UP, SDL_SCANCODE_DOWN, SDL_SCANCODE_LEFT, SDL_SCANCODE_RIGHT, - SDL_SCANCODE_I, SDL_SCANCODE_K, SDL_SCANCODE_J, SDL_SCANCODE_L }; void Config::ReadValues() { diff --git a/src/citra/default_ini.h b/src/citra/default_ini.h index 49126356f..d0b258cab 100644 --- a/src/citra/default_ini.h +++ b/src/citra/default_ini.h @@ -23,14 +23,14 @@ pad_l = pad_r = pad_zl = pad_zr = -pad_sup = -pad_sdown = -pad_sleft = -pad_sright = pad_cup = pad_cdown = pad_cleft = pad_cright = +pad_circle_up = +pad_circle_down = +pad_circle_left = +pad_circle_right = [Core] # The applied frameskip amount. Must be a power of two. diff --git a/src/citra/emu_window/emu_window_sdl2.cpp b/src/citra/emu_window/emu_window_sdl2.cpp index 12cdd9d95..591f68aa4 100644 --- a/src/citra/emu_window/emu_window_sdl2.cpp +++ b/src/citra/emu_window/emu_window_sdl2.cpp @@ -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) { - KeyPressed({ key, keyboard_id }); + KeyMap::PressKey(*this, { key, keyboard_id }); } else if (state == SDL_RELEASED) { - KeyReleased({ key, keyboard_id }); + KeyMap::ReleaseKey(*this, { key, keyboard_id }); } } @@ -168,8 +168,9 @@ void EmuWindow_SDL2::DoneCurrent() { } 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 }, Service::HID::pad_mapping[i]); + KeyMap::SetKeyMapping({ Settings::values.input_mappings[Settings::NativeInput::All[i]], keyboard_id }, KeyMap::mapping_targets[i]); } } diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index 01b81c11c..414b2f8af 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp @@ -235,12 +235,12 @@ void GRenderWindow::closeEvent(QCloseEvent* event) { void GRenderWindow::keyPressEvent(QKeyEvent* event) { - this->KeyPressed({event->key(), keyboard_id}); + KeyMap::PressKey(*this, { event->key(), keyboard_id }); } void GRenderWindow::keyReleaseEvent(QKeyEvent* event) { - this->KeyReleased({event->key(), keyboard_id}); + KeyMap::ReleaseKey(*this, { event->key(), keyboard_id }); } void GRenderWindow::mousePressEvent(QMouseEvent *event) @@ -270,8 +270,9 @@ void GRenderWindow::mouseReleaseEvent(QMouseEvent *event) void GRenderWindow::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}, Service::HID::pad_mapping[i]); + KeyMap::SetKeyMapping({ Settings::values.input_mappings[Settings::NativeInput::All[i]], keyboard_id }, KeyMap::mapping_targets[i]); } } diff --git a/src/citra_qt/config.cpp b/src/citra_qt/config.cpp index b5bb75537..ebee8c821 100644 --- a/src/citra_qt/config.cpp +++ b/src/citra_qt/config.cpp @@ -22,12 +22,15 @@ Config::Config() { } static const std::array<QVariant, Settings::NativeInput::NUM_INPUTS> defaults = { + // directly mapped keys Qt::Key_A, Qt::Key_S, Qt::Key_Z, Qt::Key_X, Qt::Key_Q, Qt::Key_W, Qt::Key_1, Qt::Key_2, Qt::Key_M, Qt::Key_N, Qt::Key_B, Qt::Key_T, Qt::Key_G, Qt::Key_F, Qt::Key_H, + Qt::Key_I, Qt::Key_K, Qt::Key_J, Qt::Key_L, + + // indirectly mapped keys Qt::Key_Up, Qt::Key_Down, Qt::Key_Left, Qt::Key_Right, - Qt::Key_I, Qt::Key_K, Qt::Key_J, Qt::Key_L }; void Config::ReadValues() { |