Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
4a49c702
Commit
4a49c702
authored
Mar 04, 2017
by
Gregory Dymarek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing compilation issues
parent
f31e10ab
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
8 deletions
+10
-8
Joystick.h
src/Joystick/Joystick.h
+2
-2
JoystickAndroid.cc
src/Joystick/JoystickAndroid.cc
+1
-0
JoystickManager.cc
src/Joystick/JoystickManager.cc
+3
-4
JoystickSDL.cc
src/Joystick/JoystickSDL.cc
+3
-2
JoystickSDL.h
src/Joystick/JoystickSDL.h
+1
-0
No files found.
src/Joystick/Joystick.h
View file @
4a49c702
...
...
@@ -95,12 +95,12 @@ public:
QVariantList
buttonActions
(
void
);
QString
name
(
void
)
{
return
_name
;
}
/*
// Joystick index used by sdl library
// Settable because sdl library remaps indicies after certain events
virtual int index(void) = 0;
virtual void setIndex(int index) = 0;
*/
virtual
bool
requiresCalibration
(
void
)
{
return
true
;
}
int
throttleMode
(
void
);
...
...
src/Joystick/JoystickAndroid.cc
View file @
4a49c702
...
...
@@ -65,6 +65,7 @@ JoystickAndroid::~JoystickAndroid() {
QtAndroidPrivate
::
unregisterKeyEventListener
(
this
);
}
QMap
<
QString
,
Joystick
*>
JoystickAndroid
::
discover
(
MultiVehicleManager
*
_multiVehicleManager
)
{
bool
joystickFound
=
false
;
static
QMap
<
QString
,
Joystick
*>
ret
;
...
...
src/Joystick/JoystickManager.cc
View file @
4a49c702
...
...
@@ -61,9 +61,8 @@ void JoystickManager::init()
_joystickCheckTimer
.
start
(
250
);
}
#elif defined(__android__)
/*
* Android Joystick not yet supported
*/
_setActiveJoystickFromSettings
();
//TODO: Investigate Android events for Joystick hot plugging & run _joystickCheckTimer if possible
#endif
}
...
...
@@ -205,7 +204,7 @@ void JoystickManager::_updateAvailableJoysticks(void)
}
#elif defined(__android__)
/*
*
Android Joystick not yet supported
*
TODO: Investigate Android events for Joystick hot plugging
*/
#endif
}
src/Joystick/JoystickSDL.cc
View file @
4a49c702
...
...
@@ -68,8 +68,9 @@ QMap<QString, Joystick*> JoystickSDL::discover(MultiVehicleManager* _multiVehicl
newRet
[
name
]
=
new
JoystickSDL
(
name
,
qMax
(
0
,
axisCount
),
qMax
(
0
,
buttonCount
),
qMax
(
0
,
hatCount
),
i
,
isGameController
,
_multiVehicleManager
);
}
else
{
newRet
[
name
]
=
ret
[
name
];
if
(
newRet
[
name
]
->
index
()
!=
i
)
{
newRet
[
name
]
->
setIndex
(
i
);
// This joystick index has been remapped by SDL
JoystickSDL
*
j
=
(
JoystickSDL
*
)
newRet
[
name
];
if
(
j
->
index
()
!=
i
)
{
j
->
setIndex
(
i
);
// This joystick index has been remapped by SDL
}
// Anything left in ret after we exit the loop has been removed (unplugged) and needs to be cleaned up.
// We will handle that in JoystickManager in case the removed joystick was in use.
...
...
src/Joystick/JoystickSDL.h
View file @
4a49c702
...
...
@@ -36,6 +36,7 @@ private:
SDL_GameController
*
sdlController
;
bool
_isGameController
;
int
_index
;
///< Index for SDL_JoystickOpen
};
#endif // JOYSTICKSDL_H
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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