Skip to content

Commit

Permalink
Don't auto-remap droped protocol function for input
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaellehmkuhl committed Jul 28, 2023
1 parent b055c59 commit cfceda8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/views/ConfigurationJoystickView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,11 @@ const updateMapping = (index: number, newValue: ProtocolInput, inputType: EventT
return
}
const oldInputMapping = inputType === EventType.Axis ? axesCorrespondencies.value : buttons.value
const inputOldValue = oldInputMapping[index]
// For the index that previously holded the selected value, use the former value of the modified index
const undefinedInput = { protocol: undefined, value: undefined }
// Let at 'unnassigned' state indexes that previously held the selected value
const newInputMapping = oldInputMapping.map((oldValue) => {
const newInputValue =
oldValue.protocol === newValue.protocol && oldValue.value === newValue.value ? inputOldValue : oldValue
oldValue.protocol === newValue.protocol && oldValue.value === newValue.value ? undefinedInput : oldValue
return newInputValue
})
newInputMapping[index] = newValue
Expand Down

0 comments on commit cfceda8

Please sign in to comment.