Linking keypress in page to a python callback

maybe you can define a callback with the keyboard module