Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. win32 Window message mapping
Qt 6.11 is out! See what's new in the release blog

win32 Window message mapping

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 775 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    brkonator
    wrote on last edited by
    #1

    Hi,

    I'm interested in how exactly Qt generates QEvent instances - specifically, how does QKeyEvent get created on Windows OS? Does it use win32 API and maps WM_KEYDOWN and WM_CHAR messages? If so, how does it work since Qt has only 1 event but Windows creates WM_KEYDOWN and then WM_CHAR (if it's one of those characters that gets translated by TranslateMessage function)? How does QKeyEvent::text() return a proper character/string, is there a source code that I can analyze? Many thanks in advance.

    jsulmJ 1 Reply Last reply
    0
    • B brkonator

      Hi,

      I'm interested in how exactly Qt generates QEvent instances - specifically, how does QKeyEvent get created on Windows OS? Does it use win32 API and maps WM_KEYDOWN and WM_CHAR messages? If so, how does it work since Qt has only 1 event but Windows creates WM_KEYDOWN and then WM_CHAR (if it's one of those characters that gets translated by TranslateMessage function)? How does QKeyEvent::text() return a proper character/string, is there a source code that I can analyze? Many thanks in advance.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @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.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      B 1 Reply Last reply
      2
      • B Offline
        B Offline
        brkonator
        wrote on last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • jsulmJ jsulm

          @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.

          B Offline
          B Offline
          brkonator
          wrote on last edited by
          #4

          @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.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SimonSchroeder
            wrote on last edited by
            #5

            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/

            1 Reply Last reply
            4

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved