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

Function DTestButton

src/drivers/Qt/input.cpp:1405–1435  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1403 * Tests to see if a specified button is currently pressed.
1404 */
1405static int
1406DTestButton(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 { \

Callers 9

updateStatusMethod · 0.70
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