|
|
|
|
|
|
|
|
console.log(e); |
|
|
console.log(e); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function handle_mouseclickevent(e){ |
|
|
|
|
|
console.log("MOUSE CLICK ON BUTTON: ", e.button); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
function TitlePainter(pal){ |
|
|
function TitlePainter(pal){ |
|
|
var elist = document.querySelectorAll(".color-NES-random"); |
|
|
var elist = document.querySelectorAll(".color-NES-random"); |
|
|
if (elist){ |
|
|
if (elist){ |
|
|
|
|
|
|
|
|
GlobalEvents.emit("set_app_palette", palette); |
|
|
GlobalEvents.emit("set_app_palette", palette); |
|
|
|
|
|
|
|
|
var input = new Input(); |
|
|
var input = new Input(); |
|
|
|
|
|
input.preventDefaults = true; |
|
|
|
|
|
input.mouseTargetElement = document.getElementById("painter"); |
|
|
input.listen("keydown", handle_keyevent); |
|
|
input.listen("keydown", handle_keyevent); |
|
|
input.listen("keyup", handle_keyevent); |
|
|
input.listen("keyup", handle_keyevent); |
|
|
input.listen("keypress", handle_keyevent); |
|
|
input.listen("keypress", handle_keyevent); |
|
|
|
|
|
|
|
|
input.listen("mousemove", handle_mouseevent); |
|
|
input.listen("mousemove", handle_mouseevent); |
|
|
input.listen("mousedown", handle_mouseevent); |
|
|
input.listen("mousedown", handle_mouseevent); |
|
|
input.listen("mouseup", handle_mouseevent); |
|
|
input.listen("mouseup", handle_mouseevent); |
|
|
|
|
|
input.listen("mouseclick", handle_mouseclickevent); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|