MCPcopy Create free account
hub / github.com/Detanup01/gbe_fork / GetConnectedControllers

Method GetConnectedControllers

dll/steam_controller.cpp:380–396  ·  view source on GitHub ↗

Enumerate currently connected controllers handlesOut should point to a STEAM_CONTROLLER_MAX_COUNT sized array of ControllerHandle_t handles Returns the number of handles written to handlesOut

Source from the content-addressed store, hash-verified

378// handlesOut should point to a STEAM_CONTROLLER_MAX_COUNT sized array of ControllerHandle_t handles
379// Returns the number of handles written to handlesOut
380int Steam_Controller::GetConnectedControllers( ControllerHandle_t *handlesOut )
381{
382 PRINT_DEBUG_ENTRY();
383 if (!handlesOut) return 0;
384 if (disabled) {
385 return 0;
386 }
387
388 int count = 0;
389 if (GamepadIsConnected(GAMEPAD_0)) {*handlesOut = GAMEPAD_0 + 1; ++handlesOut; ++count;};
390 if (GamepadIsConnected(GAMEPAD_1)) {*handlesOut = GAMEPAD_1 + 1; ++handlesOut; ++count;};
391 if (GamepadIsConnected(GAMEPAD_2)) {*handlesOut = GAMEPAD_2 + 1; ++handlesOut; ++count;};
392 if (GamepadIsConnected(GAMEPAD_3)) {*handlesOut = GAMEPAD_3 + 1; ++handlesOut; ++count;};
393
394 PRINT_DEBUG("returned %i connected controllers", count);
395 return count;
396}
397
398
399// Invokes the Steam overlay and brings up the binding screen

Calls 1

GamepadIsConnectedFunction · 0.70

Tested by

no test coverage detected