feat: close the dialog when pressing the ESC key (#180)

This commit is contained in:
Romain
2024-11-19 13:38:18 +02:00
committed by GitHub
parent 5c5b59d520
commit ea200f23dd
+10
View File
@@ -84,6 +84,16 @@ class KiCadToJLCForm(wx.Frame):
self.Centre(wx.BOTH)
# Bind the ESC key event to a handler
self.Bind(wx.EVT_CHAR_HOOK, self.onKey)
# Close the dialog when pressing the ESC key
def onKey(self, event):
if event.GetKeyCode() == wx.WXK_ESCAPE:
self.Close(True)
else:
event.Skip()
def onGenerateButtonClick(self, event):
options = dict()