[Development] Windows plugin customisation: QWindowsKeyMapper

Tor Arne Vestbø Tor.arne.Vestbo at qt.io
Sat Jul 30 18:38:20 CEST 2022



On 30 Jul 2022, at 18:29, Laszlo Papp <lpapp at kde.org<mailto:lpapp at kde.org>> wrote:

Thanks.

Should the event first be sent to the application and only if not handled, passed to Windows?

I guess that depends on what your goal is. The default implementation calls showSystemMenu(), so it doesn’t seem to pass through the app AFAICT.

Tor Arne


On Sat, Jul 30, 2022 at 5:15 PM Tor Arne Vestbø <Tor.arne.Vestbo at qt.io<mailto:Tor.arne.Vestbo at qt.io>> wrote:
Actually, you might be able to filter out the event via

https://doc.qt.io/qt-6/qcoreapplication.html#installNativeEventFilter

And pass it on manually to windows via DefWindowProc

Tor Arne

On 30 Jul 2022, at 18:12, Tor Arne Vestbø <tor.arne.vestbo at qt.io<mailto:tor.arne.vestbo at qt.io>> wrote:

Hi,

I don’t think there’s any way to customize that behavior today, apart from maintaining a customized version of the Windows platform plugin.

You could perhaps have some luck intercepting WM_APPCOMMAND before it reaches the Qt message proc?

Tor Arne

On 30 Jul 2022, at 14:12, Laszlo Papp <lpapp at kde.org<mailto:lpapp at kde.org>> wrote:

Hi,

What is the recommended way to customise the behaviour of built-in plugins, like a windows plugin , QWindowsKeyMapper in particular?

To be specific, if we wanted to pass this alt+space to the application rather than Qt forwarding it to Windows, the operating system? Like a potential break here before showing the system menu?

https://code.qt.io/cgit/qt/qtbase.git/tree/src/plugins/platforms/windows/qwindowskeymapper.cpp#n1219

Trying to figure out what the most forward-looking and future proof way rather than directly modify vanilla Qt.

Another use case (not ours) that I was told is that if someone writes a remote desktop client in Qt and it is desirable to pass alt+f4 to this application to process it inside the guest as opposed to closing the remote desktop Qt application or something similar.

One idea is environment variables, but may not be the best. Seeking your input and hope we can sort this out together.

Thank you in advance!

Kind regards,
László
_______________________________________________
Development mailing list
Development at qt-project.org<mailto:Development at qt-project.org>
https://lists.qt-project.org/listinfo/development



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20220730/47a553fa/attachment-0001.htm>


More information about the Development mailing list