Skip to content

Commit

Permalink
Disabling context menu events for our canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
tyler27 committed Jan 7, 2024
1 parent fd355f5 commit 2b76caf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/js/jagex2/client/GameShell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ export default abstract class GameShell {
window.addEventListener('keyup', this.keyUp);
window.addEventListener('mousedown', this.mousePressed);

// Preventing mouse events from bubbling up to the context menu in the browser for our canvas.
// This may need to be hooked up to our own context menu in the future.
this.canvas.oncontextmenu = (e: MouseEvent) => { e.preventDefault(); }

await this.showProgress(0, 'Loading...');
await this.load();

Expand Down

0 comments on commit 2b76caf

Please sign in to comment.