terminal/mouse: convert Event and Format to lib.Enum

Convert the Event and Format enums from fixed-size Zig enums to
lib.Enum so they are C ABI compatible when targeting C. The motion
method on Event becomes a free function eventIsMotion since lib.Enum
types cannot have declarations.
This commit is contained in:
Mitchell Hashimoto
2026-03-15 16:32:03 -07:00
parent f9f92f2e0f
commit 37efac99b0
2 changed files with 20 additions and 19 deletions

View File

@@ -93,7 +93,7 @@ pub fn encode(
// If we don't have a motion-tracking event mode, do nothing,
// because events outside the viewport are never reported in
// such cases.
if (!opts.event.motion()) return;
if (!terminal.mouse.eventSendsMotion(opts.event)) return;
// For motion modes, we only report if a button is currently pressed.
// This lets a TUI detect a click over the surface + drag out