Skip to content

Scroll Combo with keyboard / text input #1153

@rickyviking

Description

@rickyviking

I'm trying to implement a feature to allow the Combo to scroll when pressing a keyboard key.
In particular, change the active entry to the first one starting with the letter typed in (this is quite useful when you have a long combo list).
I thought I should use the IO.InputCharacters API to consume the first character input by user.
To receive and read the input char I'm using:

// capture input while showing the popup
       SetActiveID(id, window);
       g.InputTextState.Id = id;
// ...
// get the first input char if any
       ImWchar inputChar = g.IO.InputCharacters[0];

within the combo popup code and it does the trick, but it disables the following mouse inputs.
What's the correct way to listen to user input in this case?
Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    navkeyboard/gamepad navigationscrolling

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions