Add options to invert scroll direction and swap gamepad buttons

Fixes #463
Fixes #467
This commit is contained in:
Cameron Gutman 2020-12-25 22:21:20 -06:00
commit 5096ff6496
9 changed files with 103 additions and 1 deletions

View file

@ -817,6 +817,18 @@ Flickable {
StreamingPreferences.swapMouseButtons = checked
}
}
CheckBox {
id: reverseScrollButtonsCheck
hoverEnabled: true
width: parent.width
text: qsTr("Reverse mouse scrolling direction")
font.pointSize: 12
checked: StreamingPreferences.reverseScrollDirection
onCheckedChanged: {
StreamingPreferences.reverseScrollDirection = checked
}
}
}
}
@ -831,6 +843,30 @@ Flickable {
anchors.fill: parent
spacing: 5
CheckBox {
id: swapFaceButtonsCheck
width: parent.width
text: qsTr("Swap A/B and X/Y gamepad buttons")
font.pointSize: 12
checked: StreamingPreferences.swapFaceButtons
onCheckedChanged: {
// Check if the value changed (this is called on init too)
if (StreamingPreferences.swapFaceButtons !== checked) {
StreamingPreferences.swapFaceButtons = checked
// Save and restart SdlGamepadKeyNavigation so it can pull the new value
StreamingPreferences.save()
SdlGamepadKeyNavigation.disable()
SdlGamepadKeyNavigation.enable()
}
}
ToolTip.delay: 1000
ToolTip.timeout: 5000
ToolTip.visible: hovered
ToolTip.text: qsTr("This switches gamepads into a Nintendo-style button layout")
}
CheckBox {
id: singleControllerCheck
width: parent.width