pythontutor-dev / pythontutor

10 stars 4 forks source link

Keyboard shortcuts #70

Open niloct opened 4 years ago

niloct commented 4 years ago

Good evening!

First, thanks for this great tool :)

I noticed that there was an intention to add keyboard shortcuts: https://github.com/pgbovine/OnlinePythonTutor/blob/0dcdacc7ff5be504dd6a47236ebc69dc0069f991/v3/js/opt-frontend-common.js#L1546

Reading the commented out code, I have a really simple suggestion that may work:

return false; on the keydown event handler, or equivalently do e.preventDefault();. That would not trigger the scroll action but still will execute the stepBack()/stepForward().

Let me know your opinion about this!

Thanks again.

pgbovine commented 4 years ago

thanks, i'll make a note of this and try it out later.