@@ -1482,5 +1482,7 @@ bool DInputDevice::joystickDetected()
return( smJoystickCount > 0 );
}
-
+U8 DInputDevice::getJoystickCount()
+{
+ return(smJoystickCount);
+}
@@ -135,7 +135,7 @@ class DInputDevice : public InputDevice
// Console interface functions:
const char* getJoystickAxesString();
static bool joystickDetected();
- //
+ static U8 getJoystickCount();
bool process();
};
@@ -55,4 +55,14 @@ ConsoleFunctionWithDocs( getJoystickAxes, ConsoleString, 2, 2, ( instance ))
return( "" );
+/*! Returns the total number of joysticks connected, both XInput and other.
+ @return The number of joysticks connected.
+ @sa isJoystickDetected
+*/
+ConsoleFunctionWithDocs( getJoystickCount, ConsoleInt, 1, 1, ())
+ argc; argv;
+ return( DInputDevice::getJoystickCount() );
+
/*! @} */ // end group WindowsPlatform