|
|
@ -157,7 +157,7 @@ class TermScreen { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
this.canvas.addEventListener('mousedown', e => { |
|
|
|
this.canvas.addEventListener('mousedown', e => { |
|
|
|
if (this.selection.selectable || e.altKey) { |
|
|
|
if ((this.selection.selectable || e.altKey) && e.button === 0) { |
|
|
|
selectStart(e.offsetX, e.offsetY) |
|
|
|
selectStart(e.offsetX, e.offsetY) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
Input.onMouseDown(...this.screenToGrid(e.offsetX, e.offsetY), |
|
|
|
Input.onMouseDown(...this.screenToGrid(e.offsetX, e.offsetY), |
|
|
@ -275,8 +275,11 @@ class TermScreen { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.canvas.addEventListener('contextmenu', e => { |
|
|
|
this.canvas.addEventListener('contextmenu', e => { |
|
|
|
|
|
|
|
if (this.mouseMode.clicks) { |
|
|
|
// prevent mouse keys getting stuck
|
|
|
|
// prevent mouse keys getting stuck
|
|
|
|
e.preventDefault(); |
|
|
|
e.preventDefault(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
selectEnd(e.offsetX, e.offsetY); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// bind ctrl+shift+c to copy
|
|
|
|
// bind ctrl+shift+c to copy
|
|
|
@ -903,6 +906,10 @@ class TermScreen { |
|
|
|
const audioCtx = this.audioCtx; |
|
|
|
const audioCtx = this.audioCtx; |
|
|
|
if (!audioCtx) return; |
|
|
|
if (!audioCtx) return; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// prevent screeching
|
|
|
|
|
|
|
|
if (this._lastBeep && this._lastBeep > Date.now() - 50) return; |
|
|
|
|
|
|
|
this._lastBeep = Date.now(); |
|
|
|
|
|
|
|
|
|
|
|
let osc, gain; |
|
|
|
let osc, gain; |
|
|
|
|
|
|
|
|
|
|
|
// main beep
|
|
|
|
// main beep
|
|
|
|