我需要限制" alt + c" IE9,IE10,IE11的组合。我已尝试使用return false,returnValue = false,stopPropagation(),preventDefault()和cancelbubble。我仍然无法阻止IE的默认行为。我尝试使用捕鼠器跟踪代码:
private _setupKeyboardShortcuts() {
Mousetrap.stopCallback = function () {return false;
}
Mousetrap.bind('alt+c', (e) => {
// Cancel
e.preventDefault();
var event = window.event;
if (event.preventDefault)
event.preventDefault();
else
event.returnValue = false;
return false;
});
}