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
Forum Updated to NodeBB v4.3 + New Features

win32 Window message mapping

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 631 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 25 Aug 2020, 06:08 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.

    J 1 Reply Last reply 25 Aug 2020, 06:18
    0
    • B brkonator
      25 Aug 2020, 06:08

      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.

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 25 Aug 2020, 06:18 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 25 Aug 2020, 06:38
      2
      • B Offline
        B Offline
        brkonator
        wrote on 25 Aug 2020, 06:37 last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • J jsulm
          25 Aug 2020, 06:18

          @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 25 Aug 2020, 06:38 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 25 Aug 2020, 07:09 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

            1/5

            25 Aug 2020, 06:08

            • Login

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