Skip to content

list_view: jump to first/last item with Home/End keys #268

Description

@RobLoach

The list_view handles Up/Down (one item at a time) and LB/RB / NK_KEY_SCROLL_UP/DOWN (page scroll), but has no Home or End key handling to jump directly to the first or last item. See nuklear_console_list_view.h:416–480 for the full navigation block.

Suggested Implementation

Add two branches after the existing LB/RB page-scroll block:

nk_input_is_key_pressed(..., NK_KEY_TEXT_START) → selected = 0
nk_input_is_key_pressed(..., NK_KEY_TEXT_END)   → selected = item_count - 1

Mirror with a gamepad equivalent (e.g. DPAD_SELECT) if appropriate.

QA

  • Pressing Home with a list_view focused moves selection to index 0.
  • Pressing End moves to the last item.
  • Test added in nuklear_console_test.c.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions