diff options
| author | 2016-05-15 19:35:06 +0300 | |
|---|---|---|
| committer | 2016-05-15 19:35:06 +0300 | |
| commit | 6cccdcacd2c8dc442db5a8ece5e754b0ed655d8b (patch) | |
| tree | 5a673aa806a992df2f01fb90748602455b6df503 /src | |
| parent | fixup! Refactor input system (diff) | |
| download | yuzu-6cccdcacd2c8dc442db5a8ece5e754b0ed655d8b.tar.gz yuzu-6cccdcacd2c8dc442db5a8ece5e754b0ed655d8b.tar.xz yuzu-6cccdcacd2c8dc442db5a8ece5e754b0ed655d8b.zip | |
fixup! fixup! Refactor input system
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/emu_window.h | 6 | ||||
| -rw-r--r-- | src/common/key_map.h | 8 | ||||
| -rw-r--r-- | src/core/hle/service/hid/hid.cpp | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/common/emu_window.h b/src/common/emu_window.h index 0ae3ea2af..57e303b6d 100644 --- a/src/common/emu_window.h +++ b/src/common/emu_window.h | |||
| @@ -75,14 +75,14 @@ public: | |||
| 75 | /** | 75 | /** |
| 76 | * Signals a button press action to the HID module. | 76 | * Signals a button press action to the HID module. |
| 77 | * @param pad_state indicates which button to press | 77 | * @param pad_state indicates which button to press |
| 78 | * @note only handle real buttons (A/B/X/Y/...), excluding analog input like circle pad. | 78 | * @note only handles real buttons (A/B/X/Y/...), excluding analog inputs like the circle pad. |
| 79 | */ | 79 | */ |
| 80 | void ButtonPressed(Service::HID::PadState pad_state); | 80 | void ButtonPressed(Service::HID::PadState pad_state); |
| 81 | 81 | ||
| 82 | /** | 82 | /** |
| 83 | * Signals a button release action to the HID module. | 83 | * Signals a button release action to the HID module. |
| 84 | * @param pad_state indicates which button to press | 84 | * @param pad_state indicates which button to press |
| 85 | * @note only handle real buttons (A/B/X/Y/...), excluding analog input like circle pad. | 85 | * @note only handles real buttons (A/B/X/Y/...), excluding analog inputs like the circle pad. |
| 86 | */ | 86 | */ |
| 87 | void ButtonReleased(Service::HID::PadState pad_state); | 87 | void ButtonReleased(Service::HID::PadState pad_state); |
| 88 | 88 | ||
| @@ -123,7 +123,7 @@ public: | |||
| 123 | } | 123 | } |
| 124 | 124 | ||
| 125 | /** | 125 | /** |
| 126 | * Gets the current cirle pad state. | 126 | * Gets the current circle pad state. |
| 127 | * @note This should be called by the core emu thread to get a state set by the window thread. | 127 | * @note This should be called by the core emu thread to get a state set by the window thread. |
| 128 | * @todo Fix this function to be thread-safe. | 128 | * @todo Fix this function to be thread-safe. |
| 129 | * @return std::tuple of (x, y), where `x` and `y` are the circle pad coordinates | 129 | * @return std::tuple of (x, y), where `x` and `y` are the circle pad coordinates |
diff --git a/src/common/key_map.h b/src/common/key_map.h index 4b585c1b9..b62f017c6 100644 --- a/src/common/key_map.h +++ b/src/common/key_map.h | |||
| @@ -13,7 +13,7 @@ class EmuWindow; | |||
| 13 | namespace KeyMap { | 13 | namespace KeyMap { |
| 14 | 14 | ||
| 15 | /** | 15 | /** |
| 16 | * Represents a key mapping target that are not 3DS real buttons. | 16 | * Represents key mapping targets that are not real 3DS buttons. |
| 17 | * They will be handled by KeyMap and translated to 3DS input. | 17 | * They will be handled by KeyMap and translated to 3DS input. |
| 18 | */ | 18 | */ |
| 19 | enum class IndirectTarget { | 19 | enum class IndirectTarget { |
| @@ -25,7 +25,7 @@ enum class IndirectTarget { | |||
| 25 | }; | 25 | }; |
| 26 | 26 | ||
| 27 | /** | 27 | /** |
| 28 | * Represents a key mapping target. It can be a PadState that represents 3DS real buttons, | 28 | * Represents a key mapping target. It can be a PadState that represents real 3DS buttons, |
| 29 | * or an IndirectTarget. | 29 | * or an IndirectTarget. |
| 30 | */ | 30 | */ |
| 31 | struct KeyTarget { | 31 | struct KeyTarget { |
| @@ -84,12 +84,12 @@ void SetKeyMapping(HostDeviceKey key, KeyTarget target); | |||
| 84 | void ClearKeyMapping(int device_id); | 84 | void ClearKeyMapping(int device_id); |
| 85 | 85 | ||
| 86 | /** | 86 | /** |
| 87 | * Maps a key press actions and call the corresponding function in EmuWindow | 87 | * Maps a key press action and call the corresponding function in EmuWindow |
| 88 | */ | 88 | */ |
| 89 | void PressKey(EmuWindow& emu_window, HostDeviceKey key); | 89 | void PressKey(EmuWindow& emu_window, HostDeviceKey key); |
| 90 | 90 | ||
| 91 | /** | 91 | /** |
| 92 | * Maps a key release actions and call the corresponding function in EmuWindow | 92 | * Maps a key release action and call the corresponding function in EmuWindow |
| 93 | */ | 93 | */ |
| 94 | void ReleaseKey(EmuWindow& emu_window, HostDeviceKey key); | 94 | void ReleaseKey(EmuWindow& emu_window, HostDeviceKey key); |
| 95 | 95 | ||
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index a48184495..c975433f4 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp | |||
| @@ -74,7 +74,7 @@ void Update() { | |||
| 74 | 74 | ||
| 75 | PadState state = VideoCore::g_emu_window->GetPadState(); | 75 | PadState state = VideoCore::g_emu_window->GetPadState(); |
| 76 | 76 | ||
| 77 | // Get current circle pad positon and update circle pad direction | 77 | // Get current circle pad position and update circle pad direction |
| 78 | s16 circle_pad_x, circle_pad_y; | 78 | s16 circle_pad_x, circle_pad_y; |
| 79 | std::tie(circle_pad_x, circle_pad_y) = VideoCore::g_emu_window->GetCirclePadState(); | 79 | std::tie(circle_pad_x, circle_pad_y) = VideoCore::g_emu_window->GetCirclePadState(); |
| 80 | state.hex |= GetCirclePadDirectionState(circle_pad_x, circle_pad_y).hex; | 80 | state.hex |= GetCirclePadDirectionState(circle_pad_x, circle_pad_y).hex; |