Trying to find where to disable individual keyboard shortcuts in the jQuery version of TinyMCE editor. Currently the list of allowable shortcuts is:
Example code to switch back and forth from allowing I B and U in both IE and FF.
var ctrlKey = false;
function removeShortcuts(){
var e = tinyMCE.activeEditor;
for (var s in e.shortcuts){
if(s=="ctrl,,,73" || s=="ctrl,,,85" || s="ctrl,,,66"){
e.shortcuts[s].func = function(){};
}
}
e.onKeyUp.add(onKeyUp);
e.onKeyDown.add(onKeyDown);
}
function resetShortcuts(){
var e = tinyMCE.activeEditor;
if (isGecko) {
e.addShortcut('ctrl+b', t.getLang('bold_desc'), 'Bold');
e.addShortcut('ctrl+i', t.getLang('italic_desc'), 'Italic');
e.addShortcut('ctrl+u', t.getLang('underline_desc'), 'Underline');
}
e.onKeyUp.remove(onKeyUp);
e.onKeyDown.remove(onKeyDown);
}
function onKeyUp(editor, event){
if(event.keyCode == 17){
ctrlKey = false;
}
}
function onKeyDown(editor, event){
if(event.keyCode == 17){
ctrlKey = true;
}
if(ctrlKey && (event.keyCode == 73 || event.keyCode == 85 || event.keyCode == 66){
tinymce.dom.Event.cancel(event);
}
}