From edba1cc7e573dc0719fe2f62840c18a7ba675848 Mon Sep 17 00:00:00 2001 From: "R.Eugenio" Date: Tue, 23 Dec 2025 13:12:54 +0100 Subject: [PATCH] fix(virtual_list): Soportar key repeat con navKeyPressed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cambiar de keyPressed() a navKeyPressed() permite que mantener pulsada la flecha arriba/abajo mueva la selección continuamente. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- src/widgets/virtual_list/virtual_list.zig | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/widgets/virtual_list/virtual_list.zig b/src/widgets/virtual_list/virtual_list.zig index 7320056..85197ad 100644 --- a/src/widgets/virtual_list/virtual_list.zig +++ b/src/widgets/virtual_list/virtual_list.zig @@ -464,18 +464,17 @@ fn handleKeyboard( _ = provider; _ = result; - if (ctx.input.keyPressed(.up)) { - list_state.moveUp(); - } else if (ctx.input.keyPressed(.down)) { - list_state.moveDown(visible_rows); - } else if (ctx.input.keyPressed(.page_up)) { - list_state.pageUp(visible_rows); - } else if (ctx.input.keyPressed(.page_down)) { - list_state.pageDown(visible_rows, total_rows); - } else if (ctx.input.keyPressed(.home)) { - list_state.goToStart(); - } else if (ctx.input.keyPressed(.end)) { - list_state.goToEnd(visible_rows, total_rows); + // Usar navKeyPressed() para soportar key repeat (tecla mantenida pulsada) + if (ctx.input.navKeyPressed()) |key| { + switch (key) { + .up => list_state.moveUp(), + .down => list_state.moveDown(visible_rows), + .page_up => list_state.pageUp(visible_rows), + .page_down => list_state.pageDown(visible_rows, total_rows), + .home => list_state.goToStart(), + .end => list_state.goToEnd(visible_rows, total_rows), + else => {}, + } } }