MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / enableJoystick

Method enableJoystick

Engine/source/platformWin32/winDirectInput.cpp:299–328  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

297
298//------------------------------------------------------------------------------
299bool DInputManager::enableJoystick()
300{
301 DInputManager* mgr = dynamic_cast<DInputManager*>( Input::getManager() );
302 if ( !mgr || !mgr->isEnabled() )
303 return( false );
304
305 if ( smJoystickEnabled && mgr->isJoystickActive() )
306 return( true );
307
308 smJoystickEnabled = true;
309 if ( Input::isActive() )
310 smJoystickEnabled = mgr->activateJoystick();
311
312 if ( smJoystickEnabled )
313 {
314 Con::printf( "DirectInput joystick enabled." );
315#ifdef LOG_INPUT
316 Input::log( "Joystick enabled.\n" );
317#endif
318 }
319 else
320 {
321 Con::warnf( "DirectInput joystick failed to enable!" );
322#ifdef LOG_INPUT
323 Input::log( "Joystick failed to enable!\n" );
324#endif
325 }
326
327 return( smJoystickEnabled );
328}
329
330//------------------------------------------------------------------------------
331void DInputManager::disableJoystick()

Callers

nothing calls this directly

Calls 7

printfFunction · 0.85
isJoystickActiveMethod · 0.80
activateJoystickMethod · 0.80
isActiveFunction · 0.50
logFunction · 0.50
warnfFunction · 0.50
isEnabledMethod · 0.45

Tested by

no test coverage detected