Skip to content

armgit / kiln

Public Imported from GitHub
0

Build and revise procedural 3D assets with your coding agent. Local MCP server, CLI and TypeScript engine with rendered review, editable source and GLB export.

457 B
Raw Blame
export function bindFightMouse(canvas,{active,attack}){
 const press=e=>{if(!active()||e.pointerType!=='mouse'||![0,2].includes(e.button))return;e.preventDefault();attack(e.button===0?'light':'heavy');};
 const menu=e=>{if(active())e.preventDefault();};
 canvas.addEventListener('pointerdown',press);canvas.addEventListener('contextmenu',menu);
 return()=>{canvas.removeEventListener('pointerdown',press);canvas.removeEventListener('contextmenu',menu);};
}