The model should manage the selection object, in response to the controller interpreting gestures, e.g.
- click and hold mouse button gesture with no shift key down means we need to create a selection object;
- dragging the mouse while the mouse key remains held creates a visual rectangle and as that rectangle is drawn, any staff elements which fall within it have their selected property set and they are included in the list in the selection object. Only elements which are completely contained within the selection rectangle are included in the selection object;
- when the mouse key is released, and a selection object exists, the selection object is complete, nothing actually needs to happen as a result of this gesture though;
- click and hold mouse button with shift key down means start a new visual rectangle for including objects but any objects that become contained within the rectangle get appended to the existing selection object;
Keyboard gestures also drive selection actions.
- Shift and arrow keys draw the same selection rectangle, ie work like the click and hold gesture, with shift down, i.e. append to existing selection else create new.
- If you want to unselect the selection a mouse click does that or a keyboard navigation gesture does.
- Any new input of course will replace a selection, i.e. select 3 notes then enter a new one mean the 3 get deleted and the one new one gets placed at the start of the selection.
- Navigation gestures need examination. Does down arrow mean go down a line and forget any selection, or does it mean move the selection down? I think it means the former, let's think about a text component example, if you select a bunch of text then hit down arrow the caret moves down and the selection is forgotten.
Time to cogitate ...