in reply to Binding keys & mouse buttons

I would disagree with the first reply. The part quoted there doesn't "sound good" to me, because using a mouse to "click on an object in a canvas" is notoriously error-prone. The chances are too likely that users will "click an object" while in "delete" mode and then discover that they clicked the wrong object.

Even if you are planning on providing an "Undo Delete" button too, users with less-than-ideal coordination skills will become frustrated and fearful, and this should be avoided.

To avoid the problem, use a mouse click to select an object; highlight and/or identify the object in some way so the user knows exactly what was selected; the user can click again, as many times as necessary, until their intended object is the one being highlighted. Whenever an object has been selected, offer a button or menu item of some sort to delete the currently selected object (but allow the user to "deselect" the currently selected object by clicking somewhere else - possibly where there is no object, so that nothing is selected).

If you have any relevant code - maybe a simple "dummy" script that puts up a canvas with a few objects, and tries to support the action you want - post it here. As a rule, monks would prefer help you with the code that you are writing.

Replies are listed 'Best First'.
Re^2: Binding keys & mouse buttons
by Anonymous Monk on Dec 29, 2014 at 07:54 UTC

    I would disagree with the first reply....

    That is a strawman.

    Nothing in the scenario so far says don't highlight the object ... pretty much all famous programs that allow one to select+delete do these things: highlight selected objects, allow menu option to delete selected objects, allow shortcuts to delete selected objects without menu

      When the OP says, "I want to press 'Delete' and then click on an object in canvas to delete it," I understand that to mean two distinct things happening in sequence: (a) press a key to place the application into "delete mode", then (b) click a mouse button to delete whatever object is located at the current mouse position.

      (An equivalent approach, involving something like "Button1 to select, Button3 to select and delete", has no need for any key press, so it seems not to match what the OP was trying to describe, but maybe smh was having trouble expressing it clearly.)

      As for "strawman", I know that "pretty much all famous programs" offer a choice of either "select first, then delete" or "click once to select and delete" (because sometimes the risk of error is low enough that the latter really is better). It's reasonable to assume that smh is not developing a famous program; there wasn't enough info in the OP to assume that smh was planning to offer this kind of choice.

        Same difference :) drawing programs usually have an eraser , has shortcuts to activate erase , you use mouse to erase stuff ...