Skip to content

how do you activate keyboard input (for the imtui demo) #21

Answered by ggerganov
julianrendell asked this question in Q&A
Discussion options

You must be logged in to vote

Hi - this looks interesting! I've never used repl.it, but now I might give it a try.

I noticed the HN viewer does work with keypresses (though I can't figure out how to cleanly exit.)

You should be able to quit using Shift + 'q'.
This is the code that handles this:

if (ImGui::IsKeyPressed('Q', false)) {
return false;
}

You can handle any key in a similar way. Just follow the "HNTerm" app as an example.

The demo app is not designed to be used with a keyboard - one needs to have a mouse to use it.
This demo app is the same as Dear ImGui's demo app. Probably ImTui should have a separate demo app with key…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@julianrendell
Comment options

Answer selected by julianrendell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants