* Tests to see if a specified button is currently pressed. */
| 1025 | * Tests to see if a specified button is currently pressed. |
| 1026 | */ |
| 1027 | static int |
| 1028 | DTestButton (ButtConfig * bc) |
| 1029 | { |
| 1030 | |
| 1031 | if (bc->ButtType == BUTTC_KEYBOARD) |
| 1032 | { |
| 1033 | if (g_keyState[SDL_GetScancodeFromKey (bc->ButtonNum)]) |
| 1034 | { |
| 1035 | bc->state = 1; |
| 1036 | return 1; |
| 1037 | } |
| 1038 | else |
| 1039 | { |
| 1040 | bc->state = 0; |
| 1041 | } |
| 1042 | } |
| 1043 | else if (bc->ButtType == BUTTC_JOYSTICK) |
| 1044 | { |
| 1045 | if (DTestButtonJoy (bc)) |
| 1046 | { |
| 1047 | return 1; |
| 1048 | } |
| 1049 | } |
| 1050 | return 0; |
| 1051 | } |
| 1052 | |
| 1053 | |
| 1054 | #define MK(x) {BUTTC_KEYBOARD,0,MKK(x),0} |
no test coverage detected