emscripten-core / emscripten-core/emscripten
`emscripten_set_mousedown_callback` does not call the callback function from Qt Creator
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
The next example works without problems when I compile and run it from the command line: `emcc -g main.cpp -o public/index.html` But when I create `Empty qmake Project` from Qt Creater and run it - it doesn't work - it does not print "Mouse down" to the console:
main.cpp
```cpp
#include
#include
#include
// https://github.com/emscripten-core/emscripten/issues/19266
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;
});
}
```
I create a project in Qt Creator like this:

Contributor guide
Assessment
This issue has not been assessed yet.