onMousePress(action: (m: MouseButton)=>void): KEventController
Register an event that runs when user clicks mouse.
param
action- The function that is run when user clicks a mouse button.
// gives cookies on left press, remove on right press let cookies = 0; onMousePress(["left", "right"], (m) => { if (m == "left") { cookies++; } else { cookies--; } });
returns
The event controller.
since
v3001.0