Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-126582

emscripten_set_mousedown_callback does not call the callback function

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • None
    • 6.6.3
    • None
    • WebAssembly

    Description

      The following example works without problems when I compile it from CMD using this command: emcc -g main.cpp -o public/index.html

      main.cpp

       

      #include <emscripten.h>
      #include <emscripten/html5.h>
      #include <iostream>
      
      int main()
      {
          // Mouse Button Down:
          emscripten_set_mousedown_callback(
              EMSCRIPTEN_EVENT_TARGET_WINDOW, nullptr, 0, +[](int eventType,
              const EmscriptenMouseEvent *e, void *userData) -> EM_BOOL
              {
                  std::cout << "Mouse down: " << e->button << "\n";
                  return EM_FALSE;
              });
      }
      

      But when I create the "Empty qmake Project" in Qt Creator and run the example above but it doesn't work. I mean it doesn't print anything to the browser console.

      I don't know it is Qt issue or Emscripten. So I have created an issue for Emscripten too: https://github.com/emscripten-core/emscripten/issues/22133

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.webassembly qt.webassembly
            8observer8 Ivan Enzhaev
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes