Global shortcuts should not send keyrelease event to app with focus (Re: KStandardAction::rename ?)

Martin Gräßlin mgraesslin at kde.org
Sun Feb 19 19:53:14 UTC 2017



Am 19. Februar 2017 18:00:07 MEZ schrieb David Faure <faure at kde.org>:
>On dimanche 19 février 2017 12:51:39 CET Martin Gräßlin wrote:
>> Am 19. Februar 2017 11:21:18 MEZ schrieb David Faure <faure at kde.org>:
>> >Result: the test app shows the keypress events for Ctrl and Alt
>> >(obviously),
>> >it does not show the keypress for K (good, this matches my
>> >expectation),
>> >BUT when I release K, the app receives a key *RELEASE* event for
>Key_K.
>> >
>> >Martin, is this a bug and is it fixable?
>> 
>> That is not a bug and is the expected and correct behavior. 
>
>Can you elaborate why this is expected? If I press a workspace-wide
>global 
>shortcut like Alt+F2 or Ctrl+Alt+K, then I intend for that to go to the
>
>workspace, not to the window with focus. The fact that this window does
>not 
>receive a keypress but receives a keyrelease for that key seems very 
>inconsistent and unexpected to me.

That is how X works *shrug*. It is quite normal that applications can get key release events for keys they did not get a press for.

Press a key then switch focus using the mouse and release the key. Same thing.

Also on Wayland quite normal. Except that the protocol informs which keys are currently pressed. But iirc Qt (rightly) ignores that information.

The application is at fault if it acts on a release without a press.

>
>> Also the window gets a focus out and focus on event.
>
>OK but that doesn't prevent processing the key release event.


More information about the Kde-frameworks-devel mailing list