mirror of https://github.com/nealey/vail.git
Disable popup on RMB
This commit is contained in:
parent
55dbdf8635
commit
79d34e1d64
|
@ -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))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue