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

emscripten_request_pointerlock() returns EMSCRIPTEN_RESULT_UNKNOWN_TARGET

    XMLWordPrintable

Details

    • WebAssembly

    Description

      I have made an example (I have attached it) that calls `emscripten_request_pointerlock("screen", false);` by mouse click:

      void mousePressEvent(QMouseEvent *event) override
      {
          EMSCRIPTEN_RESULT result = emscripten_request_pointerlock("screen", false);
          qDebug() << result;
      }
      

       

      It prints -4 to the console that means `EMSCRIPTEN_RESULT_UNKNOWN_TARGET`. I use `screen` because Qt's generated .html file has this element `<div id="screen"></div>`.

      I have tried to use `EMSCRIPTEN_EVENT_TARGET_DOCUMENT` instead of `screen` but it returns -1 (it means `EMSCRIPTEN_RESULT_NOT_SUPPORTED`):

      EMSCRIPTEN_RESULT result = emscripten_request_pointerlock(
                  EMSCRIPTEN_EVENT_TARGET_DOCUMENT, false);
      qDebug() << result;

      Topic: https://forum.qt.io/topic/157324/emscripten_request_pointerlock-returns-emscripten_result_unknown_target

      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:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes