Bug #1531
openQt client, Shortcuts options dialog, try to change to used shortcut causes the used shortcut action to happen sometimes
0%
Description
Qt5, Mac 3.0 & 3.1
Game->Options->Shortcuts, from the Shortcuts options dialog press the button for an option and then enter, e.g. F8, get error msg that F8 is "ALREADY ASSIGNED TO ... Top Five Cities", and also the "Top Five Cities" report appears. Same thing for some but not all other shortcuts, I saw it for Ctrl/Meta+S "Save Game", and Ctrl/Meta+P "City Production", but not F "Fortify", not Shift+D "Disband", and not Shift+P "Pillage".
Updated by Dean Brown 5 days ago
The difference between the cases where it happens and when it doesn't appears to be whether the key event is something that a QLineEdit is designed to handle. But the menu system processes the key event first, before line_edit::keyReleaseEvent() gets it, so adding a call to grabKeyboard() in line_edit::line_edit() doesn't help. A QLineEdit can have an input mask, but it won't let you allow F8 or Ctrl/Meta.
Maybe can over-ride keyReleaseEvent() at the QApplication or QMenu level? But awkward to test if there's a line_edit active.