Project

General

Profile

Actions

Bug #14723

closed
MS

globalKeyWentDown not emitted if a widget has the focus

Bug #14723: globalKeyWentDown not emitted if a widget has the focus

Added by Michael Seibt 20 days ago. Updated 20 days ago.

Status:
Rejected
Priority:
High
Assignee:
-
Target version:
-
Start date:
08/06/2026
Due date:
% Done:

0%

Estimated time:

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:

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 Actions #1

  • 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 Actions #2

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.

Actions

Also available in: PDF Atom