Hello,
I can't get the keydown event to work. I don't get any errors and I
don't see anything wrong with the code...
I also am wondering if there is an API for the event argument that
is passed into the function for keydown?
How do I get the name of the key like 'f', or '3'?
Also, why not put keys into a key, mod structure like every other
library with a keyboard event handler?
Here is my code:
from browser import document, html, alert
def presser(event):
alert("Hit it")
document <= html.H1("This is text with the event bound to it",
Id="h")
document['h'].bind('keydown',presser)