comparison nuklear_ui/blastem_nuklear.c @ 2319:ab3d8759da08

Slightly more reasonable threshold value for axes during mapping. Still pretty broken though
author Michael Pavone <pavone@retrodev.com>
date Sun, 02 Apr 2023 23:38:21 -0700
parents e836cf11783b
children 94cf5cc89227
comparison
equal deleted inserted replaced
2318:1c7329ac7f3f 2319:ab3d8759da08
1287 mapping_string[mapping_pos++] = '0' + hat_value; 1287 mapping_string[mapping_pos++] = '0' + hat_value;
1288 added_mapping = 1; 1288 added_mapping = 1;
1289 1289
1290 last_hat = hat_moved; 1290 last_hat = hat_moved;
1291 last_hat_value = hat_value; 1291 last_hat_value = hat_value;
1292 } else if (axis_moved >= 0 && abs(axis_value) > 1000 && ( 1292 } else if (axis_moved >= 0 && abs(axis_value) > 4000 && (
1293 axis_moved != last_axis || ( 1293 axis_moved != last_axis || (
1294 axis_value/abs(axis_value) != last_axis_value/abs(axis_value) && current_button >= SDL_CONTROLLER_BUTTON_DPAD_UP 1294 axis_value/abs(axis_value) != last_axis_value/abs(axis_value) && current_button >= SDL_CONTROLLER_BUTTON_DPAD_UP
1295 ) 1295 )
1296 )) { 1296 )) {
1297 if (current_button <= SDL_CONTROLLER_BUTTON_B || axis_moved != button_a_axis) { 1297 if (current_button <= SDL_CONTROLLER_BUTTON_B || axis_moved != button_a_axis) {
2441 else if (event->type == SDL_JOYHATMOTION) { 2441 else if (event->type == SDL_JOYHATMOTION) {
2442 hat_moved = event->jhat.hat; 2442 hat_moved = event->jhat.hat;
2443 hat_value = event->jhat.value; 2443 hat_value = event->jhat.value;
2444 } 2444 }
2445 else if (event->type == SDL_JOYAXISMOTION) { 2445 else if (event->type == SDL_JOYAXISMOTION) {
2446 if (event->jaxis.axis == axis_moved || abs(event->jaxis.value) > abs(axis_value) || abs(event->jaxis.value) > 1000) { 2446 if (event->jaxis.axis == axis_moved || abs(event->jaxis.value) > abs(axis_value) || abs(event->jaxis.value) > 4000) {
2447 axis_moved = event->jaxis.axis; 2447 axis_moved = event->jaxis.axis;
2448 axis_value = event->jaxis.value; 2448 axis_value = event->jaxis.value;
2449 } 2449 }
2450 } else if (event->type == SDL_MOUSEBUTTONDOWN && event->button.button == 0) { 2450 } else if (event->type == SDL_MOUSEBUTTONDOWN && event->button.button == 0) {
2451 click = 1; 2451 click = 1;