MCPcopy Create free account
hub / github.com/TASEmulators/fceux / DTestButton

Function DTestButton

src/drivers/sdl/input.cpp:1027–1051  ·  view source on GitHub ↗

* Tests to see if a specified button is currently pressed. */

Source from the content-addressed store, hash-verified

1025 * Tests to see if a specified button is currently pressed.
1026 */
1027static int
1028DTestButton (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}

Callers 8

UpdateGamepadFunction · 0.70
UpdatePPadDataFunction · 0.70
UpdateFKBFunction · 0.70
UpdateHyperShotFunction · 0.70
UpdateMahjongFunction · 0.70
UpdateQuizKingFunction · 0.70
UpdateTopRiderFunction · 0.70
UpdateFTrainerFunction · 0.70

Calls 1

DTestButtonJoyFunction · 0.70

Tested by

no test coverage detected