Answer the question
In order to leave comments, you need to log in
ctrl+enter keyboard shortcut not working in firefox, how to fix?
Wrote code to send an error message. When selected and pressed ctrl+enter, the function is called. It works in chrome but not in firefox. Help me please.
Here is the code:
document.onkeydown = function (e){
var txt = '';
if (txt = window.getSelection) {// Не IE, используем метод getSelection
txt = window.getSelection().toString();
} else { // IE, используем объект selection
txt = document.selection.createRange().text;
}
if(e.keyCode == 17)
ctrl = true;
else if(e.keyCode == 13 && ctrl && txt != '')
oFB_mistape.open( txt );
}
document.onkeyup = function (e){
if(e.keyCode == 17)
ctrl = false;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question