Hi Sanjyot and anyone else interested in Keyboard Events,
Here's a video that explains how keyboard events work. I think the issue you ran into while testing is that you had not yet clicked inside the lesson.
Sample lesson (source attached): https://lrs.smartbuilder.com/l/c429len5vhu3
Hope that helps!