Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
831d2f86
Commit
831d2f86
authored
Feb 08, 2019
by
Willian Galvani
Browse files
JoystickConfig.qml: Change deadband adjustment to dragging horizontally
parent
d20bd666
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/VehicleSetup/JoystickConfig.qml
View file @
831d2f86
...
...
@@ -849,20 +849,24 @@ SetupPage {
MouseArea
{
id
:
deadbandMouseArea
anchors.fill
:
parent
.
item
enabled
:
controller
.
deadbandToggle
id
:
deadbandMouseArea
anchors.fill
:
parent
.
item
enabled
:
controller
.
deadbandToggle
preventStealing
:
true
property
real
startY
property
real
startX
property
real
direction
onPressed
:
{
startY
=
mouseY
startX
=
mouseX
direction
=
startX
>
width
/
2
?
1
:
-
1
parent
.
item
.
deadbandColor
=
"
#3C6315
"
}
onPositionChanged
:
{
var
newValue
=
parent
.
item
.
deadbandValue
+
(
startY
-
mouseY
)
*
15
var
mouseToDeadband
=
32768
/
(
width
/
2
)
// Factor to have deadband follow the mouse movement
var
newValue
=
parent
.
item
.
deadbandValue
+
direction
*
(
mouseX
-
startX
)
*
mouseToDeadband
if
((
newValue
>
0
)
&&
(
newValue
<
32768
)){
parent
.
item
.
deadbandValue
=
newValue
;}
start
Y
=
mouse
Y
start
X
=
mouse
X
}
onReleased
:
{
controller
.
setDeadbandValue
(
modelData
,
parent
.
item
.
deadbandValue
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment