Skip to content

Commit

Permalink
Add back support for custom buttons to control analog inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed May 8, 2023
1 parent e078f61 commit 9623f51
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Core/ControlMapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -504,10 +504,12 @@ void ControlMapper::PSPKey(int deviceId, int pspKeyCode, int flags) {
if (flags & KEY_DOWN) {
virtKeys_[vk] = 1.0f;
onVKey(pspKeyCode, true);
onVKeyAnalog(deviceId, pspKeyCode, 1.0f);
}
if (flags & KEY_UP) {
virtKeys_[vk] = 0.0f;
onVKey(pspKeyCode, false);
onVKeyAnalog(deviceId, pspKeyCode, 0.0f);
}
} else {
// INFO_LOG(SYSTEM, "pspKey %d %d", pspKeyCode, flags);
Expand Down
2 changes: 1 addition & 1 deletion Core/ControlMapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ControlMapper {

// Inject raw PSP key input directly, such as from touch screen controls.
// Combined with the mapped input. Unlike __Ctrl APIs, this supports
// virtual key codes, though not analog mappings.
// virtual key codes, including analog mappings.
void PSPKey(int deviceId, int pspKeyCode, int flags);

// Toggle swapping DPAD and Analog. Useful on some input devices with few buttons.
Expand Down

0 comments on commit 9623f51

Please sign in to comment.