clay/renderers
Seintian c700104760 feat(ncurses): Add interaction callbacks and improve input handling
Introduces Input Processing and Interaction helpers for the Ncurses renderer, ensuring robust mouse support and simplified event handling.

**Renderer (`renderers/ncurses`):**
- **`Clay_Ncurses_ProcessInput`**: Added a dedicated input processing function that handles both keyboard and mouse events.
  - Implemented persistent `_isMouseDown` state tracking to fix missed "fast clicks" and preserve button state during drag operations.
  - Adjusted `mousemask` to `BUTTON1_PRESSED | BUTTON1_RELEASED | REPORT_MOUSE_POSITION` to bypass Ncurses' internal click resolution delay.
- **`Clay_Ncurses_OnClick`**: Added a helper function to easily attach click listeners.
  - Registers the user's callback directly via `Clay_OnHover` (avoiding allocation/proxies).
  - Matches the standard Clay callback signature pattern.

**Example (`examples/ncurses-example`):**
- **Input Loop**: Migrated main loop to use `Clay_Ncurses_ProcessInput`.
- **Interactions**:
  - Added a "Toggle Help" button to the sidebar.
  - Implemented `HandleHelpToggleClick` callback, which explicitly checks for `CLAY_POINTER_DATA_RELEASED_THIS_FRAME` to validate clicks.
  - Added visual hover effects to sidebar items.

**Documentation (`renderers/ncurses/README.md`):**
- Updated "Usage" section to demonstrate `Clay_Ncurses_ProcessInput`.
- Added "Input & Interaction" section documenting the new helpers.
2025-12-28 22:17:27 +01:00
..
cairo [Renderers/Cairo] Fix cairo renderer and example (#416) 2025-05-19 11:36:08 +12:00
ncurses feat(ncurses): Add interaction callbacks and improve input handling 2025-12-28 22:17:27 +01:00
playdate [Renderers/Playdate] Playdate console example (#404) 2025-05-19 11:46:39 +12:00
raylib [Renderers/Raylib] Fix element float distortion (#430) 2025-06-05 10:49:26 +10:00
SDL2 [Renderers/SDL] Font sizing is ignored (#444) 2025-06-23 09:30:14 +10:00
SDL3 [Renderers/SDL3] Fix border position calculated incorrectly (#446) 2025-06-23 10:43:08 +10:00
sokol [Renderers/Sokol] allow usage of images with sokol renderer (#489) 2025-09-08 11:35:18 +10:00
termbox2 [Renderers/termbox] fixed horizontal text culling bug (#525) 2025-10-23 12:58:39 +11:00
terminal [Renderers/Terminal] Add initial implementation of terminal renderer (#91) 2025-05-22 12:45:52 +12:00
web [Renderers/Web] treat RenderCommand.commandType as uint8_t instead of uint32_t (#162) 2025-01-05 14:34:16 +13:00
win32_gdi [Renderers/WinGDI] Working on Win32 GDI renderer and example (#344) 2025-04-09 11:31:33 +12:00