I'd like to capture the user-clicked keys through IronPython. I understand a bit of C #, but I'm not understanding how I would do this in Python.
Code:
import clr
clr.AddReference('System.Windows.Forms')
from System.Windows.Forms import KeyEventArgs, Form, Application, Button
class App(Form):
def __init__(self):
self.KeyUp = self.TeclaClicada #Não sei como faria, aqui está o erro.
self.Text = "Capturar tecla"
def TeclaClicada(self, key):
print(key)
form = App()
Application.Run(form)