summaryrefslogtreecommitdiffstats
path: root/src/common/key_map.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/key_map.cpp')
-rw-r--r--src/common/key_map.cpp31
1 files changed, 22 insertions, 9 deletions
diff --git a/src/common/key_map.cpp b/src/common/key_map.cpp
index ad311d66b..79b3fcb18 100644
--- a/src/common/key_map.cpp
+++ b/src/common/key_map.cpp
@@ -3,7 +3,6 @@
// Refer to the license.txt file included.
#include <map>
-
#include "common/emu_window.h"
#include "common/key_map.h"
@@ -13,11 +12,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 +62,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 +117,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 +149,4 @@ void ReleaseKey(EmuWindow& emu_window,HostDeviceKey key) {
}
}
}
-
}