summaryrefslogtreecommitdiff
path: root/src/citra/emu_window/emu_window_sdl2.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2016-06-10 22:28:58 -0400
committerGitHub <noreply@github.com>2016-06-10 22:28:58 -0400
commitf99961581ee129c44625dbd8890fab349253271a (patch)
tree9a2610d391d795b533054a91c22763e869bdd62b /src/citra/emu_window/emu_window_sdl2.cpp
parentce2aee819a6c48a96c17c7ca507128b3e9478d92 (diff)
parent6cccdcacd2c8dc442db5a8ece5e754b0ed655d8b (diff)
Merge pull request #1789 from wwylele/input-refactor
Refactor input mapping & implement circle pad modifier
Diffstat (limited to 'src/citra/emu_window/emu_window_sdl2.cpp')
-rw-r--r--src/citra/emu_window/emu_window_sdl2.cpp7
1 files changed, 4 insertions, 3 deletions
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]);
}
}