sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Erase Selection from within any plugin (VK_DELETE)

    Scheduled Pinned Locked Moved Developers' Forum
    2 Posts 2 Posters 212 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • fredo6F Offline
      fredo6
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • Dan RathbunD Offline
        Dan Rathbun
        last edited by

        @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 to super,) but puts'ing the method name to STDOUT.

        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.)

        I'm not here much anymore.

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Buy SketchPlus
        Buy SUbD
        Buy WrapR
        Buy eBook
        Buy Modelur
        Buy Vertex Tools
        Buy SketchCuisine
        Buy FormFonts

        Advertisement