Erase Selection from within any plugin (VK_DELETE)
-
I realized that, within any plugin, the user can type DEL and erase the selection if any (likewise, s/he can type Ctrl-A or Ctrl-T to Select all or Unselect All).
The problem with DEL key is that I did not find a good way to capture the event.
- you get a Key-UP event with VK_DELETE, but only AFTER the deletion is performed. So you have no clue what has been erased and even if something has been erased at all. When you get the VK_DELETE key, the selection is already empty.
- The Selection observers remain completely silent about the erasing of the current selection. No event is fired.
So my questions is whether there is a way to capture the DEL event, at least know if something was deleted.
Fredo
-
@fredo6 said:
- The Selection observers remain completely silent about the erasing of the current selection. No event is fired.
Not true... they are calling misspelled callbacks.
To see what the SkecthUp engine wants to call (even tho the spelling is a bug,) ... override the
respond_to?()
method in your observer subclass, (being sure to pass the arg on tosuper
,) butputs
'ing the method name toSTDOUT
.Once you know the mispelling... you can write wrapper callbacks that use the mispelled method name that simply call the correctly spelled callback (or just alias the bad names to the good names.)
Advertisement