Skip to content

Commit

Permalink
fix buffed mapping (#767)
Browse files Browse the repository at this point in the history
  • Loading branch information
lightmanLP authored Dec 19, 2024
1 parent 0aa813d commit 3d8420e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
8 changes: 6 additions & 2 deletions src/controller/controldevice/controller/ControllerButton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,12 @@ bool ControllerButton::AddOrEditButtonMappingFromRawPress(CONTROLLERBUTTONS_T bi

bool ControllerButton::ProcessKeyboardEvent(KbEventType eventType, KbScancode scancode) {
if (mUseKeydownEventToCreateNewMapping && eventType == LUS_KB_EVENT_KEY_DOWN) {
mKeyboardScancodeForNewMapping = scancode;
return true;
if (eventType == LUS_KB_EVENT_KEY_DOWN) {
mKeyboardScancodeForNewMapping = scancode;
return true;
} else {
mKeyboardScancodeForNewMapping = LUS_KB_UNKNOWN;
}
}

bool result = false;
Expand Down
10 changes: 7 additions & 3 deletions src/controller/controldevice/controller/ControllerStick.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,13 @@ void ControllerStick::UpdatePad(int8_t& x, int8_t& y) {
}

bool ControllerStick::ProcessKeyboardEvent(KbEventType eventType, KbScancode scancode) {
if (mUseKeydownEventToCreateNewMapping && eventType == LUS_KB_EVENT_KEY_DOWN) {
mKeyboardScancodeForNewMapping = scancode;
return true;
if (mUseKeydownEventToCreateNewMapping) {
if (eventType == LUS_KB_EVENT_KEY_DOWN) {
mKeyboardScancodeForNewMapping = scancode;
return true;
} else {
mKeyboardScancodeForNewMapping = LUS_KB_UNKNOWN;
}
}

bool result = false;
Expand Down

0 comments on commit 3d8420e

Please sign in to comment.