diff options
| author | 2016-05-12 13:09:36 +0300 | |
|---|---|---|
| committer | 2016-05-15 13:24:22 +0300 | |
| commit | 03631f9b8fe75cf1c3a70a3094aeddcebffa4cf9 (patch) | |
| tree | 95edc62b3b8520a533e534bf4991159875fef3e5 /src/citra/emu_window/emu_window_sdl2.cpp | |
| parent | AudioCore: Implement time stretcher (#1737) (diff) | |
| download | yuzu-03631f9b8fe75cf1c3a70a3094aeddcebffa4cf9.tar.gz yuzu-03631f9b8fe75cf1c3a70a3094aeddcebffa4cf9.tar.xz yuzu-03631f9b8fe75cf1c3a70a3094aeddcebffa4cf9.zip | |
Refactor input subsystem
Diffstat (limited to 'src/citra/emu_window/emu_window_sdl2.cpp')
| -rw-r--r-- | src/citra/emu_window/emu_window_sdl2.cpp | 7 |
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) { | |||
| 40 | 40 | ||
| 41 | void EmuWindow_SDL2::OnKeyEvent(int key, u8 state) { | 41 | void EmuWindow_SDL2::OnKeyEvent(int key, u8 state) { |
| 42 | if (state == SDL_PRESSED) { | 42 | if (state == SDL_PRESSED) { |
| 43 | KeyPressed({ key, keyboard_id }); | 43 | KeyMap::PressKey(*this, { key, keyboard_id }); |
| 44 | } else if (state == SDL_RELEASED) { | 44 | } else if (state == SDL_RELEASED) { |
| 45 | KeyReleased({ key, keyboard_id }); | 45 | KeyMap::ReleaseKey(*this, { key, keyboard_id }); |
| 46 | } | 46 | } |
| 47 | } | 47 | } |
| 48 | 48 | ||
| @@ -168,8 +168,9 @@ void EmuWindow_SDL2::DoneCurrent() { | |||
| 168 | } | 168 | } |
| 169 | 169 | ||
| 170 | void EmuWindow_SDL2::ReloadSetKeymaps() { | 170 | void EmuWindow_SDL2::ReloadSetKeymaps() { |
| 171 | KeyMap::ClearKeyMapping(keyboard_id); | ||
| 171 | for (int i = 0; i < Settings::NativeInput::NUM_INPUTS; ++i) { | 172 | for (int i = 0; i < Settings::NativeInput::NUM_INPUTS; ++i) { |
| 172 | KeyMap::SetKeyMapping({ Settings::values.input_mappings[Settings::NativeInput::All[i]], keyboard_id }, Service::HID::pad_mapping[i]); | 173 | KeyMap::SetKeyMapping({ Settings::values.input_mappings[Settings::NativeInput::All[i]], keyboard_id }, KeyMap::mapping_targets[i]); |
| 173 | } | 174 | } |
| 174 | } | 175 | } |
| 175 | 176 | ||