mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-01 22:30:42 -07:00
overlay: prevent overlay from queueing up keyboard input while overlay is not visible (#677)
## Link to GitHub Issue or related Pull Request, if one exists Fixes #675 Yet another regression from #604 ## Description of change When overlay was hidden (not visible) it was still accepting keyboard input, so when it became visible again the queued up keystrokes got processed all at once. Also, fix a bug with monitor settings update kicking in when in windowed mode - this really should have been only for full screen. ## Testing Tested DDR windowed / full screen, TDJ with subscreen overlay windowed / fullscreen.
This commit is contained in:
@@ -352,6 +352,8 @@ void ImGui_ImplSpice_NewFrame() {
|
||||
// only process new input from devices if window is in focus
|
||||
// (when not in focus, all mouse/keyboard events are treated as released)
|
||||
const auto accept_new_input = superexit::has_focus() && !rawinput::OS_WINDOW_ACTIVE;
|
||||
const auto accept_new_keyboard_input = accept_new_input &&
|
||||
(overlay::OVERLAY && overlay::OVERLAY->has_focus());
|
||||
|
||||
// remember old state
|
||||
std::array<BYTE, VKEY_MAX> KeysDownOld;
|
||||
@@ -410,7 +412,7 @@ void ImGui_ImplSpice_NewFrame() {
|
||||
break;
|
||||
}
|
||||
case rawinput::KEYBOARD: {
|
||||
if (accept_new_input) {
|
||||
if (accept_new_keyboard_input) {
|
||||
// iterate all virtual key codes
|
||||
for (size_t vKey = 0; vKey < VKEY_MAX; vKey++) {
|
||||
// get state (combined from all pages)
|
||||
|
||||
Reference in New Issue
Block a user