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

Method enableXInput

Engine/source/platformWin32/winDirectInput.cpp:392–425  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

390
391//------------------------------------------------------------------------------
392bool DInputManager::enableXInput()
393{
394 // Largely, this series of functions is identical to the Joystick versions,
395 // except that XInput cannot be "activated" or "deactivated". You either have
396 // the DLL or you don't. Beyond that, you have up to four controllers
397 // connected at any given time
398
399 DInputManager* mgr = dynamic_cast<DInputManager*>( Input::getManager() );
400 if ( !mgr || !mgr->isEnabled() )
401 return( false );
402
403 if ( mgr->isXInputActive() )
404 return( true );
405
406 if ( Input::isActive() )
407 mgr->activateXInput();
408
409 if ( smXInputEnabled )
410 {
411 Con::printf( "XInput enabled." );
412#ifdef LOG_INPUT
413 Input::log( "XInput enabled.\n" );
414#endif
415 }
416 else
417 {
418 Con::warnf( "XInput failed to enable!" );
419#ifdef LOG_INPUT
420 Input::log( "XInput failed to enable!\n" );
421#endif
422 }
423
424 return( smXInputEnabled );
425}
426
427//------------------------------------------------------------------------------
428void DInputManager::disableXInput()

Callers

nothing calls this directly

Calls 7

printfFunction · 0.85
isXInputActiveMethod · 0.80
activateXInputMethod · 0.80
isActiveFunction · 0.50
logFunction · 0.50
warnfFunction · 0.50
isEnabledMethod · 0.45

Tested by

no test coverage detected