addToSelectionOnModifiers() question

Hi, I am confused with SelectedItemSet::addToSelectionOnModifiers(,) method …

When a component gets the focus, I call mySelectedItemSet->addToSelectionOnModifiers(focusedItem, ModifiersKey::commandModifier).

But it is just added to selection, whatever I press KeyCommand or not !?

Why ?

The answer is to use ModifierKey::allModifiers as argument, otherwise it cannot rule.

en français, ‘to rule’ est synonyme de diriger ou gouverner. fallait que je le dise, tu utilises le mot dans chaque post :slight_smile: ce que tu veux certainement dire est que ‘ça fonctionne’, en anglais: ‘to work’.

TBH I’ve no idea what you’re on about here. Why would you call addToSelectionOnModifiers unless you want to give it some real key modifiers from an actual event?

jules : right, this is what it ‘works’ since I’ve put it in a ::mouse… callback.

And I use ‘e.mods’ as second argument.

zamrate : ahah, ok, je trouvais que work était trop ‘basic’ pour être le bon mot… merci. :slight_smile: