ps3dev / PSL1GHT

A lightweight PS3 SDK
www.psl1ght.com
MIT License
226 stars 64 forks source link

Get Held Inputs #146

Closed Fewnity closed 1 month ago

Fewnity commented 1 month ago

I'm trying to use ioPadGetData(0, &paddata) to read the input. When the X button is pressed I got 1 in paddata.BTN_CROSS, but the next frame, paddata.BTN_CROSS equals 0 but I'm still pressing X. So I don't understand how to detect if I'm still pressing the X button.

Any idea? Thanks!

Fewnity commented 1 month ago

My bad, looks like I have to use ioPadClearBuf after ioPadGetData, but not sure why.

Fewnity commented 1 month ago

Well, looks like the ioPadGetData function is broken

int controllerIndex = 0;
padData paddata = padData();
s32 result = ioPadGetData(controllerIndex, &paddata);
// Print button array values
ioPadClearBuf(controllerIndex);

Sometimes between 0 to 10 times each seconds the paddata is not filled, I have all variable set to 0. Even the "seven" variable of the structure is set to 0. result is always equals to 0.

I'm using ioPadPeriphGetData instead and now it's working, I can get inputs without getting a 0 filled struct.

Fewnity commented 1 month ago

Found the problem, I updated the doc here: https://github.com/ps3dev/PSL1GHT/pull/149