Bug #14723
closedglobalKeyWentDown not emitted if a widget has the focus
0%
Description
Affected: WApplication::globalKeyWentDown of Wt 4.14.0 (used to work before including 4.13.4; most likely broken by the fix for Bug #14476: No key events to WDialog if title clicked or not containing interactive widgets)
The signal is not emitted if various widgets have the focus (checked with WCheckBox, WPushButton, WTableView, WTreeView, WTabWidget)
STR:
- run the https://redmine.emweb.be/attachments/download/7520/main.cpp of #14476
- focus a widget
- press keys --> no "globalKeyWentDown " in the trace
- click outside widgets (regardless of whether in or outside a WPanel)
- press keys --> "globalKeyWentDown " is traced
Remember Improvements #14321: Clarification WApplication::globalKeyWentDown/Up and WDialog::keyWentDown/Up
and - particularly my last comment to - Improvements #13791: WApplication::globalKeyWentDown dead as long as WMenu focused by mouse click
RM Updated by Romain Mardulyn 20 days ago
- Status changed from New to Rejected
Hi Michael,
This is not a bug. WApplication::globalKeyWentDown if any widget has the focus. This simply means that if an element on your page has the focus, WApplication::globalKeyWentDown will not be emitted.
MS Updated by Michael Seibt 20 days ago
Hi Romain,
so you mean this was broken from 4.11.4, at least, to 4.13.4?
I need to repeat:
In UI frameworks, globalKeyWentDown usually fires on all key presses regardless of the focus (and provides means to intercept key presses). One can simulate this to a certain degree by adding the handler to all widgets. This is error-prone, pretty inconvenient and not feasible for e.g. WMenu because it does not expose such signals.
OT: WMenu is a black hole. The keyboard focus never returns - regardless of whether the user selected an item or simply closed the drop-down.
WApplication::globalKeyWentDown enabled me to implement mnemonics without iterating all widgets and connecting tons of handlers. And beware if widgets are added at runtime.