Search code examples
javascriptgoogle-chromepixi.jswacompen-tablet

mousedown event in PIXI doesn't get triggered with creative pen


I have an issue where I have a button on my canvas which works great when I use a regular mouse, but when I use my Wacom creative pen tablet the button seems to not work.

mainLayer.on("mousedown", () => start());

Solution

  • You can use the Chrome dev tools to set event breakpoints and see what actually gets triggered.

    To set breakpoints with chrome dev-tools:

    Event breakpoints

    But my guess is that you use mousedown instead of pointerdown.

    So, this should fix it:

    mainLayer.on("pointerdown", () => start());
    

    You can read more about the Interaction events Pixi supports here: PIXI docs