An issue with node.on(cc.Node.EventType.MOUSE_MOVE) v2.4.9

Hello guys. In Google Chrome(i checked only mac os) cc.Node.EventType.MOUSE_MOVE returns wrong button id.

When i press the left button of a mouse the event returns 0(cc.Event.EventMouse.BUTTON_LEFT) and the same result if i press the right button.

But other events(cc.Event.EventMouse.MOUSE_UP, cc.Node.EventType.MOUSE_DOWN) work correctly.

Also all mouse events work fine in safari.

Creator v2.4.9.

Hi, I’m testing on 2.4.x latest version 2.4.11. The result I get is that my chrome browser on my mac, which gets the button IDs of my left and right mouse button presses, is correct. You may wish to check this out.
If there is still doubt, you can attach your demo to me.


NewProject_1.zip (235.5 KB)

Hello. Your demo is not correct. I am talking about this:

const {ccclass} = cc._decorator;

@ccclass
export default class NewClass extends cc.Component {
    start () {
        this.node.on(cc.Node.EventType.MOUSE_MOVE, this.onMove, this);
    }

    private onMove(ev: cc.Event.EventMouse) {
        console.log('TEST', ev.getButton(), cc.Event.EventMouse.BUTTON_LEFT, cc.Event.EventMouse.BUTTON_RIGHT);
    }
}

As i said before the cc.Node.EventType.MOUSE_UP and cc.Node.EventType.MOUSE_DOWN work correctly. The problem only with the cc.Node.EventType.MOUSE_MOVE event.

I can reproduce your question now.

Thank you for your feedback, this issue can be reproduced steadily, it is probably a bug in the engine, I have created a new issue to the engine group Chrome on mac is getting the wrong button ID on mouse_move · Issue #14119 · cocos/cocos-engine · GitHub, we will fix this issue as soon as possible.

Fix in 2.4.12