I am using the jQuery UI Selectable component. In order to allow multiple selections without holding down control/command I have the following: (from another thread)
jQuery("#myUnorderedList").bind("mousedown", function(event) {
return event.metaKey = true;
}).selectable();`
This works fine and dandy for selecting multiple items and allowing dragging to select. The problem is that binding mousedown to metaKey does not provide the same behaviour as actually holding the command/control key.
Here's a short screencast showing the behaviour - screencast example
Here is an example on jsfiddle (from another user, not myself) - metaKey set to true
On the jfiddle example, say if you select the first 4 by clicking and dragging. 4 are now selected. Since the metaKey is set to true we can click on 5 or 6 to add to the selection. If instead you click and drag on 5 and up over 4 (which is already selected) then drag back to 5 without releasing your mouse then 4 becomes unselected.
Try the same thing, but this time holding command/control. If the first 4 are selected, then you click and drag on 5 (still with command/control pressed) up over 4 and back down, 4 stays selected.
Basically it is making selected items unselected when being dragged over, but with the command/control key pressed the ones that are selected stay selected.
I have console.log'ed the metaKey for each event of stop, start, selecting, unselecting, and it all returns true, when metaKey is bound to mousedown, but the behaviour is not the same as actually holding down the command key.