How to pass keypresses through?

I don’t fully understand (not surprising)

Are both of these snippets of code inserted into the gui.lua file? Or is the key handler section added to main.lua?
If so, does it matter where? line numbers helpful/appreciated!

I’m also using the “fixed” version of zynzilla from this thread if that makes a difference: Could somebody please fix ZynZilla?

many thanks