Merge pull request #20201 from Roy-043/Draft-make-Draft_Edit-also-detect-key-up-events

Draft: make Draft_Edit also detect key up events
This commit is contained in:
Chris Hennes
2025-03-17 11:57:24 -05:00
committed by GitHub

View File

@@ -412,14 +412,14 @@ class Edit(gui_base_original.Modifier):
"""Execute as callback for keyboard event."""
# TODO: Get the keys from preferences
event = event_callback.getEvent()
if event.getState() == coin.SoKeyboardEvent.DOWN:
if event.getState() in (coin.SoKeyboardEvent.DOWN, coin.SoKeyboardEvent.UP):
key = event.getKey()
# App.Console.PrintMessage("pressed key : "+str(key)+"\n")
if key == 65307: # ESC
self.finish()
if key == 101: # "e"
self.display_tracker_menu(event)
if key == 65535 and Gui.Selection.GetSelection() is None: # BUG: delete key activate Std::Delete command at the same time!
if key == 65535 and Gui.Selection.getSelection() is None: # BUG: delete key activate Std::Delete command at the same time!
print("DELETE PRESSED\n")
self.delPoint(event)