How to listen to mouse and key event on the main window

Hello, I read below to listen to mouse and key event

https://docs.juce.com/master/tutorial_listeners_and_broadcasters.html

However, I cannot make it

My program is a desktop windows type program, not plug-in

So, could you please introduce to me how to listen to mouse and PC keyboard and receive events from them?

Thank you

Hello, I solved the issue for mouse input
But cannot solve for key press input

So you can help me for key press event issue
Thanks