diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2016-09-18 02:38:01 +0200 |
---|---|---|
committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2016-09-18 02:38:01 +0200 |
commit | dc8479928c5aee4c6ad6fe4f59006fb604cee701 (patch) | |
tree | 569a7f13128450bbab973236615587ff00bced5f /src/common/key_map.cpp | |
parent | Travis: Import Dolphin’s clang-format hook. (diff) | |
download | yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.gz yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.bz2 yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.lz yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.xz yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.zst yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.zip |
Diffstat (limited to '')
-rw-r--r-- | src/common/key_map.cpp | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/src/common/key_map.cpp b/src/common/key_map.cpp index ad311d66b..e882f5f52 100644 --- a/src/common/key_map.cpp +++ b/src/common/key_map.cpp @@ -13,11 +13,25 @@ namespace KeyMap { // and map it directly to EmuWindow::ButtonPressed. // It should go the analog input way like circle pad does. const std::array<KeyTarget, Settings::NativeInput::NUM_INPUTS> mapping_targets = {{ - Service::HID::PAD_A, Service::HID::PAD_B, Service::HID::PAD_X, Service::HID::PAD_Y, - Service::HID::PAD_L, Service::HID::PAD_R, Service::HID::PAD_ZL, Service::HID::PAD_ZR, - Service::HID::PAD_START, Service::HID::PAD_SELECT, Service::HID::PAD_NONE, - Service::HID::PAD_UP, Service::HID::PAD_DOWN, Service::HID::PAD_LEFT, Service::HID::PAD_RIGHT, - Service::HID::PAD_C_UP, Service::HID::PAD_C_DOWN, Service::HID::PAD_C_LEFT, Service::HID::PAD_C_RIGHT, + Service::HID::PAD_A, + Service::HID::PAD_B, + Service::HID::PAD_X, + Service::HID::PAD_Y, + Service::HID::PAD_L, + Service::HID::PAD_R, + Service::HID::PAD_ZL, + Service::HID::PAD_ZR, + Service::HID::PAD_START, + Service::HID::PAD_SELECT, + Service::HID::PAD_NONE, + Service::HID::PAD_UP, + Service::HID::PAD_DOWN, + Service::HID::PAD_LEFT, + Service::HID::PAD_RIGHT, + Service::HID::PAD_C_UP, + Service::HID::PAD_C_DOWN, + Service::HID::PAD_C_LEFT, + Service::HID::PAD_C_RIGHT, IndirectTarget::CirclePadUp, IndirectTarget::CirclePadDown, @@ -49,7 +63,8 @@ static void UpdateCirclePad(EmuWindow& emu_window) { --y; float modifier = circle_pad_modifier ? Settings::values.pad_circle_modifier_scale : 1.0; - emu_window.CirclePadUpdated(x * modifier * (y == 0 ? 1.0 : SQRT_HALF), y * modifier * (x == 0 ? 1.0 : SQRT_HALF)); + emu_window.CirclePadUpdated(x * modifier * (y == 0 ? 1.0 : SQRT_HALF), + y * modifier * (x == 0 ? 1.0 : SQRT_HALF)); } int NewDeviceId() { @@ -103,7 +118,7 @@ void PressKey(EmuWindow& emu_window, HostDeviceKey key) { } } -void ReleaseKey(EmuWindow& emu_window,HostDeviceKey key) { +void ReleaseKey(EmuWindow& emu_window, HostDeviceKey key) { auto target = key_map.find(key); if (target == key_map.end()) return; @@ -135,5 +150,4 @@ void ReleaseKey(EmuWindow& emu_window,HostDeviceKey key) { } } } - } |