Skip to content
Snippets Groups Projects
Commit b0168754 authored by deepdigger's avatar deepdigger
Browse files

add that Enter Button press on index page does the same as "Host Game"-Button

parent db369599
Branches
1 merge request!8Merge Changes into custom-server, mainly paint-functionality
......@@ -11,6 +11,12 @@ document.addEventListener("DOMContentLoaded",async()=>{
const gameID = document.location.hash.substring(1);
client = new SkribblClient(gameID);
}else{
document.addEventListener("keypress", e=>{
if(e.key=="Enter"){
let clickEvent = new CustomEvent("click");
button.dispatchEvent(clickEvent);
}
})
/** @type {HTMLButtonElement} *///@ts-ignore
const button = document.getElementById("button");
await new Promise(resolve=>{button.addEventListener("click",async e=>{
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment