5e7abfb56b
Plan input handling and pattern placement before Game of Life mechanics: keyboard bindings config, mouse placement with preview/rotation, HiDPI scaling, and cell grid. Update AGENTS.md project notes.
2.2 KiB
2.2 KiB
Proposal
Why
wlgol currently renders an animated stripe pattern and has no Game of Life state, no input handling beyond Escape, and no HiDPI awareness. Before implementing the automaton, the application needs a usable interaction layer: configurable keyboard bindings, mouse-driven placement of patterns with a live preview, and rendering that stays crisp on scaled displays. This change establishes that layer so later GoL mechanics can build on it.
What Changes
- Add configurable keyboard bindings loaded from
~/.config/wlgol/keys.conf(TOML), merged over built-in defaults, with modifier-aware matching (Ctrl/Shift/Alt/Super). - Extend keyboard handling to report active modifiers and dispatch bound actions (
quit,cancel,rotate,select:<pattern>,clear,pause,step,speed_up,speed_down,toggle_grid). - Implement mouse tracking and click handling: selecting a tool shows a rotating preview that follows the cursor;
Spacerotates 90°; left click places the pattern (tool stays armed);Esccancels. - Add a cell grid (8 logical px per cell, wall boundary) with storage, resize-with-preserve, and rendering of alive cells.
- Add four built-in patterns (Glider, Blinker, Block, Toad) with rotation support.
- Add HiDPI scaling (fractional via
wp_fractional_scale+wp_viewporter, fallback towl_output.scale) with logical/physical coordinate conversion. - Auto-generate a default
keys.confon first run if missing.
Capabilities
New Capabilities
keyboard-bindings: configurable, modifier-aware key-to-action mapping with defaults and TOML override.pattern-placement: tool selection, live preview, rotation, click placement, cancellation.display-scaling: fractional and integer HiDPI scaling with logical/physical conversion.cell-grid: grid storage, resize handling, wall boundary, alive-cell rendering.
Modified Capabilities
None.
Impact
- Affected code:
wlgol.c,tkeyboard.c/h,tpointer.c/h; new modulesconfig,grid,pattern,scale,render. - New dependency: vendored
tomlc99for TOML parsing; generated Wayland protocolsviewporterandfractional-scale-v1. - Config I/O under
~/.config/wlgol/; no public API changes.