Fixed mouse toggle check (issue #181).

Clear out other keys/buttons when pressing one of the modifier keys.
This commit is contained in:
Volker Ruppert 2023-12-23 10:32:15 +01:00
parent f1bab0c057
commit 664fdae152

View File

@ -699,6 +699,9 @@ bool bx_gui_c::mouse_toggle_check(Bit32u key, bool pressed)
if (pressed) {
newstate |= key;
if (newstate == toggle_keystate) return 0;
if ((key == BX_MT_KEY_CTRL) || (key == BX_MT_KEY_ALT)) {
newstate &= (BX_MT_KEY_CTRL | BX_MT_KEY_ALT);
}
switch (toggle_method) {
case BX_MOUSE_TOGGLE_CTRL_MB:
toggle = (newstate & BX_GUI_MT_CTRL_MB) == BX_GUI_MT_CTRL_MB;