diff options
author | Automerge Bot <bot@example.com> | 2022-10-09 03:35:41 +0300 |
---|---|---|
committer | Automerge Bot <bot@example.com> | 2022-10-09 03:35:41 +0300 |
commit | a31ddea65fed62423a39c02a504b6eb00c6f88ec (patch) | |
tree | 4afe036914852997ac404c474a3c8f5f9562601e /src | |
parent | 401023670424c8a618a601e7939d2c9dc10fb55b (diff) | |
parent | 1ad9a3d857eb4fa39bebe665009c8fff1b6c8223 (diff) |
Merge branch 'master' of https://github.com/TASVideos/fceux into coolgirl
Diffstat (limited to 'src')
-rw-r--r-- | src/drivers/Qt/input.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/drivers/Qt/input.cpp b/src/drivers/Qt/input.cpp index 9bddbc7c..ff4c4f34 100644 --- a/src/drivers/Qt/input.cpp +++ b/src/drivers/Qt/input.cpp @@ -65,7 +65,7 @@ static int cspec = 0; static int buttonConfigInProgress = 0; extern int gametype; -static int DTestButton(ButtConfig *bc); +static int DTestButton(ButtConfig *bc, bool isFKB = false); //std::list<gamepad_function_key_t *> gpKeySeqList; @@ -1416,12 +1416,18 @@ void ButtonConfigEnd() * Tests to see if a specified button is currently pressed. */ static int -DTestButton(ButtConfig *bc) +DTestButton(ButtConfig *bc, bool isFKB) { - if (bc->ButtType == BUTTC_KEYBOARD) { - if (g_keyState[SDL_GetScancodeFromKey(bc->ButtonNum)]) + bool ignoreKB = false; + bool fkbActv = g_fkbEnabled && (CurInputType[2] == SIFC_FKB); + + if (fkbActv) + { + ignoreKB = !isFKB; + } + if (!ignoreKB && g_keyState[SDL_GetScancodeFromKey(bc->ButtonNum)]) { bc->state = 1; return 1; @@ -1753,6 +1759,10 @@ void FCEUD_SetInput(bool fourscore, bool microphone, ESI port0, ESI port1, CurInputType[1] = port1; CurInputType[2] = fcexp; } + if (CurInputType[2] != SIFC_FKB) + { + g_fkbEnabled = false; + } replaceP2StartWithMicrophone = microphone; @@ -1880,7 +1890,7 @@ static void UpdateFKB(void) vkeyDown = getFamilyKeyboardVirtualKey(50); - leftShiftDown = DTestButton(&fkbmap[50]) || vkeyDown; + leftShiftDown = DTestButton(&fkbmap[50], true) || vkeyDown; for (x = 0; x < FAMILYKEYBOARD_NUM_BUTTONS; x++) { @@ -1896,7 +1906,7 @@ static void UpdateFKB(void) vkeyDown = getFamilyKeyboardVirtualKey(x); - if (DTestButton(&fkbmap[x]) || vkeyDown) + if (DTestButton(&fkbmap[x], true) || vkeyDown) { fkbkeys[x] = 1; |