cocos2d-html5cocos2d-js

Cocos2d-JS HTML 3.0 not registering mouse input


I am trying to register when I move the mouse and clicks, but I cant get it to react

I have the following where my keyboard inputs are fine and I get a log message printed fine with whatever key I press, but with my mouse the only thing I get is "registering mouse movements" from my log message, and no exception is thrown

My keyboard and mouse logic looks like this

   if ('mouse' in cc.sys.capabilities){
        cc.log("registering mouse movements");
        cc.eventManager.addListener({
            event: cc.EventListener.MOUSE,
            onMouseMove: function(event){   
                var str = "MousePosition X: " + event.getLocationX() + "  Y:" + event.getLocationY();
                cc.log(str);
                // do something...
            },
            onMouseUp: function(event){
                var str = "Mouse Up detected, Key: " + event.getButton();
                cc.log(str);
                // do something...
            },
            onMouseDown: function(event){
                var str = "Mouse Down detected, Key: " + event.getButton();
                cc.log(str);
                // do something...
            },
            onMouseScroll: function(event){
                var str = "Mouse Scroll detected, X: " + event.getLocationX() + "  Y:" + event.getLocationY();
                cc.log(str);
                // do something...
            }
        },this);
    }

    if (cc.sys.capabilities.hasOwnProperty('keyboard'))
        cc.eventManager.addListener({
            event: cc.EventListener.KEYBOARD,
            onKeyPressed:function (key, event) {
            },
            onKeyReleased:function (key, event) {
                cc.log("sf");
                cc.log(key.toString());
            }
        }, this);

I am running the latests javascript version 3.0


Solution

  • My Lenovo Laptop have gesture support for Windows 8 which gives Windows the idea that I have "Limited touch support" with this disabled Lenovo Ultranav driver. Now it works as it should in browser, in Win32 it still fails to register mouse events