Hi! I'm trying to get data from DualShock 4 connected via USB in C++, but i can't get any data, and JslConnectDevices says that there is 1 controller and i'm trying to get pressed buttons through JslGetButtons(1); but it always says "0". Also i created function to get connected controller type through switch (JslGetControllerType(1)) and for a second it says "DualShock 4" but after that "No data"
What i did wrong? My code:
int countcontr = JslConnectDevices();
int* deviceIds = new int(countcontr);
JslGetConnectedDeviceHandles(deviceIds, countcontr);
std::string s = std::to_string(JslGetSimpleState(1).buttons);
s = "Input: " + s + " Controllers: " + std::to_string(count);
char const* pchar = s.c_str();
PutText(8, (WINDOW_HEIGHT - 8), pchar, RGB(0xFF, 0xFF, 0xFE));
PutText is function for printing strings on the screen
UPD: after four hours of reading README.md and thinking i've set callback function and it's working!
Hi! I'm trying to get data from DualShock 4 connected via USB in C++, but i can't get any data, and
JslConnectDevices
says that there is 1 controller and i'm trying to get pressed buttons throughJslGetButtons(1);
but it always says "0". Also i created function to get connected controller type throughswitch (JslGetControllerType(1))
and for a second it says "DualShock 4" but after that "No data" What i did wrong? My code:PutText
is function for printing strings on the screenUPD: after four hours of reading README.md and thinking i've set callback function and it's working!