First of all - it is easy to undo a delete operation for the user - just perform “Undo”. For me, as a user, a dialog asking me to be sure about the deletion would be irritating, rather than helpful. But you may have good reasons to do this.
So then, instead of monitoring the Sup (do you mean “Del” or “Backspace”?) key, why don’t you monitor RhinoDoc.DeleteRhinoObject?
Then, show the message box asking the user if they indeed want to delete the object. If they do not want to delete the object, put this script to perform the undo operation from code:
bool confirmDelete; //defined as outcome of the dialog
if (!confirmDelete)
{
RhinoApp.Sendscript("_-Undo _Enter", false);
}
I’m testing the DeleteRhinoObject event, but I dont know how differentiate, for example, when a object is deleted because the user pushed the sup or del key, or when the user move the object (In this case the object is deleted and is created a new object in the new position, so that, the DeleteRhinoObject event is fired)