* Tests to see if a specified button is currently pressed. */
| 1403 | * Tests to see if a specified button is currently pressed. |
| 1404 | */ |
| 1405 | static int |
| 1406 | DTestButton(ButtConfig *bc, bool isFKB) |
| 1407 | { |
| 1408 | if (bc->ButtType == BUTTC_KEYBOARD) |
| 1409 | { |
| 1410 | bool ignoreKB = false; |
| 1411 | bool fkbActv = g_fkbEnabled && (CurInputType[2] == SIFC_FKB); |
| 1412 | |
| 1413 | if (fkbActv) |
| 1414 | { |
| 1415 | ignoreKB = !isFKB; |
| 1416 | } |
| 1417 | if (!ignoreKB && g_keyState[SDL_GetScancodeFromKey(bc->ButtonNum)]) |
| 1418 | { |
| 1419 | bc->state = 1; |
| 1420 | return 1; |
| 1421 | } |
| 1422 | else |
| 1423 | { |
| 1424 | bc->state = 0; |
| 1425 | } |
| 1426 | } |
| 1427 | else if (bc->ButtType == BUTTC_JOYSTICK) |
| 1428 | { |
| 1429 | if (DTestButtonJoy(bc)) |
| 1430 | { |
| 1431 | return 1; |
| 1432 | } |
| 1433 | } |
| 1434 | return 0; |
| 1435 | } |
| 1436 | |
| 1437 | #define MK(x) \ |
| 1438 | { \ |
no test coverage detected