mirror of
https://github.com/bradgrantham/apple2e.git
synced 2024-06-17 15:29:37 +00:00
set env var PROBE_JOYSTICKS to probe axes and buttons
This commit is contained in:
parent
216f74cc32
commit
b76c734115
|
@ -1783,11 +1783,20 @@ void iterate(const ModeHistory& history, unsigned long long current_byte, float
|
|||
const float* axes = glfwGetJoystickAxes(GLFW_JOYSTICK_1, &axis_count);
|
||||
const unsigned char* buttons = glfwGetJoystickButtons(GLFW_JOYSTICK_1, &button_count);
|
||||
|
||||
if(false) {
|
||||
static bool printedProbing = false;
|
||||
if(!printedProbing) {
|
||||
{
|
||||
static bool checkedJoystickProbing = false;
|
||||
static bool doJoystickProbe = false;
|
||||
|
||||
if(!checkedJoystickProbing) {
|
||||
doJoystickProbe = (getenv("PROBE_JOYSTICKS") != NULL);
|
||||
checkedJoystickProbing = true;
|
||||
}
|
||||
|
||||
if(doJoystickProbe) {
|
||||
static bool printedJoystickProbing = false;
|
||||
if(!printedJoystickProbing) {
|
||||
printf("Joystick probing:\n");
|
||||
printedProbing = true;
|
||||
printedJoystickProbing = true;
|
||||
}
|
||||
for(int i = 0; i < axis_count; i++) {
|
||||
if(fabsf(axes[i]) > 0.01) {
|
||||
|
@ -1800,6 +1809,7 @@ void iterate(const ModeHistory& history, unsigned long long current_byte, float
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(axis_count <= joystick_axis0 || axis_count <= joystick_axis1) {
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user