Right Mouse Button is not detected
-
wrote on 27 Oct 2021, 23:10 last edited by
Below is QML code containing a MouseArea and some Texts that show if LeftButton and/or RightButton are pressed.
On Desktop, everything works as expected. But when compiled for WebAssembly, only LeftButton press is registered.
RightButton is not detected, even if Left is also pressed down. MiddleButton doesn't seem to work as well.Tested on Firefox and Chrome.
The project is built using QtCreator with generated by default main.cpp and CMakeLists.txt.
Versions used: Qt 6.2.1, Emscripten 2.0.14.import QtQuick import QtQuick.Window Window { width: 640 height: 480 visible: true MouseArea { anchors.fill: parent acceptedButtons: Qt.AllButtons Text { id: text_left anchors.centerIn: parent font.pixelSize: 28 text: "Left button: " + ((parent.pressedButtons & Qt.LeftButton) ? "pressed" : "not pressed") } Text { id: text_right anchors.top: text_left.bottom anchors.horizontalCenter: parent.horizontalCenter font.pixelSize: 28 text: "Right button: " + ((parent.pressedButtons & Qt.RightButton) ? "pressed" : "not pressed") } } }
-
Below is QML code containing a MouseArea and some Texts that show if LeftButton and/or RightButton are pressed.
On Desktop, everything works as expected. But when compiled for WebAssembly, only LeftButton press is registered.
RightButton is not detected, even if Left is also pressed down. MiddleButton doesn't seem to work as well.Tested on Firefox and Chrome.
The project is built using QtCreator with generated by default main.cpp and CMakeLists.txt.
Versions used: Qt 6.2.1, Emscripten 2.0.14.import QtQuick import QtQuick.Window Window { width: 640 height: 480 visible: true MouseArea { anchors.fill: parent acceptedButtons: Qt.AllButtons Text { id: text_left anchors.centerIn: parent font.pixelSize: 28 text: "Left button: " + ((parent.pressedButtons & Qt.LeftButton) ? "pressed" : "not pressed") } Text { id: text_right anchors.top: text_left.bottom anchors.horizontalCenter: parent.horizontalCenter font.pixelSize: 28 text: "Right button: " + ((parent.pressedButtons & Qt.RightButton) ? "pressed" : "not pressed") } } }
wrote on 9 Dec 2021, 09:53 last edited by+1 for this issue, a real show-stopper for our project.
-
wrote on 27 Dec 2021, 20:23 last edited by
Thanks for this. Although the proper place for bug reports is at https://bugreports.qt.io
I have made one for you:
https://bugreports.qt.io/browse/QTBUG-99474 -
wrote on 27 Dec 2021, 21:30 last edited by
This is already fixed in 6.2.3, and 6.3