diff options
author | David Skoland <david.skoland@qt.io> | 2021-10-16 18:59:13 +0200 |
---|---|---|
committer | David Skoland <david.skoland@qt.io> | 2021-10-18 08:07:20 +0200 |
commit | 2c648fea57205dd5822da0d6ec89e4de10936ddd (patch) | |
tree | 860bb12b1dd0c6c51cce130e33877b70fdcd8853 /src/plugins/platforms/wasm/qwasmeventtranslator.cpp | |
parent | 73119e27b31e7d5b48e1cd3fcbe2f6edf049da5d (diff) |
Add comment about the meaning of magic number in QWasmEventTranslator
Without this comment, the button == 0 code is very cryptic.
This comment helps in deciphering what exactly is being checked.
Change-Id: Ied96118362d097d7036bafcc491b8574e1225de1
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmeventtranslator.cpp')
-rw-r--r-- | src/plugins/platforms/wasm/qwasmeventtranslator.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/platforms/wasm/qwasmeventtranslator.cpp b/src/plugins/platforms/wasm/qwasmeventtranslator.cpp index a3e02d9d4a..1344af3816 100644 --- a/src/plugins/platforms/wasm/qwasmeventtranslator.cpp +++ b/src/plugins/platforms/wasm/qwasmeventtranslator.cpp @@ -465,6 +465,11 @@ bool QWasmEventTranslator::processMouse(int eventType, const EmscriptenMouseEven pressedButtons.setFlag(button); + // button overview: + // 0 = primary mouse button, usually left click + // 1 = middle mouse button, usually mouse wheel + // 2 = right mouse button, usually right click + // from: https://w3c.github.io/uievents/#dom-mouseevent-button if (mouseEvent->button == 0) { pressedWindow = window2; buttonEventType = QEvent::MouseButtonPress; |