Right-click: Custom context menu instead of browser default #1

Closed
opened 2026-03-20 09:43:00 +00:00 by claude · 3 comments
Collaborator

Problem

A right-click anywhere on the game canvas triggers the browser's native context menu, which offers to "save image". This is disruptive and not part of the game experience.

Goal

Prevent the browser default context menu on the canvas and replace it with a custom in-game context menu.

Expected Behaviour

  • Right-click on the game world → show a context-sensitive game menu (e.g. actions for the tile or entity under the cursor)
  • Right-click on UI elements → either suppress menu entirely or show relevant options
  • No browser context menu ever appears while the game is focused

Open Questions

  • What actions should appear in the context menu? (move, inspect, interact, build, ...?)
  • Should the menu be context-sensitive (different options per tile/entity type)?
  • Visual style: match the existing UI or a floating popup?

Notes

  • event.preventDefault() on contextmenu event suppresses the browser menu
  • Phaser has input.mouse.disableContextMenu() for this
  • Custom menu can be rendered via UIScene or as a Phaser container
## Problem A right-click anywhere on the game canvas triggers the browser's native context menu, which offers to "save image". This is disruptive and not part of the game experience. ## Goal Prevent the browser default context menu on the canvas and replace it with a **custom in-game context menu**. ## Expected Behaviour - Right-click on the game world → show a context-sensitive game menu (e.g. actions for the tile or entity under the cursor) - Right-click on UI elements → either suppress menu entirely or show relevant options - No browser context menu ever appears while the game is focused ## Open Questions - What actions should appear in the context menu? (move, inspect, interact, build, ...?) - Should the menu be context-sensitive (different options per tile/entity type)? - Visual style: match the existing UI or a floating popup? ## Notes - `event.preventDefault()` on `contextmenu` event suppresses the browser menu - Phaser has `input.mouse.disableContextMenu()` for this - Custom menu can be rendered via UIScene or as a Phaser container
claude added the
feature
improvement
labels 2026-03-20 09:43:00 +00:00
tekki added this to the Nissefolk project 2026-03-20 10:19:47 +00:00
tekki moved this to In discussion in Nissefolk on 2026-03-20 10:30:38 +00:00
claude added the
status: in discussion
label 2026-03-20 10:43:57 +00:00
Owner

The context menu should show nothing as default. Just take the input and stop the browser from doing something else.

In the world it could have buttons for build and folks.

The context menu should show nothing as default. Just take the input and stop the browser from doing something else. In the world it could have buttons for build and folks.
Owner

The visual should go well with the other overlay objects.

The visual should go well with the other overlay objects.
Author
Collaborator

Summary

Default behaviour: No menu — always suppress the browser context menu, nothing more.

In the world: Show buttons for Build and Folks.

Visual style: Consistent with existing overlay objects.

## Summary **Default behaviour:** No menu — always suppress the browser context menu, nothing more. **In the world:** Show buttons for `Build` and `Folks`. **Visual style:** Consistent with existing overlay objects.
claude added
status: ready
and removed
status: in discussion
labels 2026-03-20 11:48:35 +00:00
claude added
status: review
and removed
status: ready
labels 2026-03-20 11:58:21 +00:00
tekki closed this issue 2026-03-20 12:01:55 +00:00
claude added
status: done
and removed
status: review
labels 2026-03-20 12:14:36 +00:00
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: tekki/nissefolk#1
No description provided.