EXPORT_C_(void) PADupdate(int pad) { // Gamepad inputs don't count as an activity. Therefore screensaver will // be fired after a couple of minute. // Emulate an user activity static int count = 0; count++; if ((count & 0xFFF) == 0) { // 1 call every 4096 Vsync is enough XResetScreenSaver(GSdsp); } // Actually PADupdate is always call with pad == 0. So you need to update both // pads -- Gregory // Poll keyboard/mouse event. There is currently no way to separate pad0 from pad1 event. // So we will populate both pad in the same time for (int cpad = 0; cpad < GAMEPAD_NUMBER; cpad++) { key_status->keyboard_state_acces(cpad); } PollForX11KeyboardInput(); // Get joystick state + Commit for (int cpad = 0; cpad < GAMEPAD_NUMBER; cpad++) { key_status->joystick_state_acces(cpad); PollForJoystickInput(cpad); key_status->commit_status(cpad); } }
EXPORT_C_(void) PADupdate(int pad) { // Actually PADupdate is always call with pad == 0. So you need to update both // pads -- Gregory for (int cpad = 0; cpad < 2; cpad++) { // Poll keyboard/mouse event key_status->keyboard_state_acces(cpad); PollForX11KeyboardInput(cpad); // Get joystick state key_status->joystick_state_acces(cpad); PollForJoystickInput(cpad); key_status->commit_status(cpad); } }