Keypress example on Juce demo

Hello. I try to understand how keypress event works. May somebody show on working example --please.


 This is code from Juce demo windows (I use it in my application)

                    DialogWindow::LaunchOptions options;                 


                    DialogWindow* dw = options.launchAsync();


And what i must do next if i want to tigger(or detect) event of  space bar key pressed?

Thank you.

You’ll have to work your way through in designing a Component, and need to override this method,
juce::Component::keyStateChanged(), or this one juce::Component::keyPressed()