Disable popup on RMB

This commit is contained in:
Neale Pickett 2020-04-10 14:59:15 +00:00
parent 55dbdf8635
commit 79d34e1d64
1 changed files with 7 additions and 0 deletions

View File

@ -43,6 +43,11 @@ function key(event) {
myosc.stop(ac.currentTime + duration * 0.001) myosc.stop(ac.currentTime + duration * 0.001)
} }
function canWeJustNot(event) {
event.preventDefault()
return false
}
function init() { function init() {
let wsUrl = new URL(window.location) let wsUrl = new URL(window.location)
wsUrl.protocol = "ws:" wsUrl.protocol = "ws:"
@ -50,6 +55,8 @@ function init() {
window.socket = new WebSocket(wsUrl) window.socket = new WebSocket(wsUrl)
window.socket.addEventListener("message", message) window.socket.addEventListener("message", message)
// disable RMB context menu
document.addEventListener("contextmenu", e => canWeJustNot(e))
document.addEventListener("mousedown", e => key(e)) document.addEventListener("mousedown", e => key(e))
document.addEventListener("keydown", e => key(e)) document.addEventListener("keydown", e => key(e))
} }