Reputation: 11778
How can I define an action (on click) which is only call when a specific modifier key is pressed?
allowedKeys also executes the action when no modifier keys are pressed.
Upvotes: 0
Views: 21
Reputation: 3207
One approach will be just do
<div onclick={{action 'itemClick'}}> my item </div>
and in your controller/parent component
actions: {
itemClick(e){
if (e.altKey) {
// alt key
} else if (e.ctrlKey) {
// ctrl key
}
}
}
Upvotes: 1