Unsolved win32 Window message mapping
-
Hi,
I'm interested in how exactly Qt generates
QEvent
instances - specifically, how doesQKeyEvent
get created on Windows OS? Does it use win32 API and mapsWM_KEYDOWN
andWM_CHAR
messages? If so, how does it work since Qt has only 1 event but Windows createsWM_KEYDOWN
and thenWM_CHAR
(if it's one of those characters that gets translated by TranslateMessage function)? How doesQKeyEvent::text()
return a proper character/string, is there a source code that I can analyze? Many thanks in advance. -
@brkonator Not sure anybody can give you exact answer, but since Qt is open source you could check the source code.
"is there a source code that I can analyze?" - yes, checkout git://code.qt.io/qt/qt5.git as shown here: https://wiki.qt.io/Building_Qt_5_from_Git
You can for example search for WM_KEYDOWN in the source tree to quickly find the place where it is used. -
This post is deleted! -
@jsulm Thanks, I usually use a web interface to search through the source code but I couldn't find anything. It's much easier in the downloaded sources. I think qindowskeymapper.cpp is the file I was looking for. If anybody has a deeper insight into this though, I'm happy to hear some opinions.
-
I don't have any clue about Qt's internals and I couldn't find it right away. However, I believe that you should be looking inside one of these files: https://code.woboq.org/qt5/qtbase/src/corelib/kernel/