Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable ACE Editor's Find Dialog

I would like to disable the ACE Editor's find dialog, which is invoked by pressing the Command + F key combination when the editor has focus.

I've tried the following (among other things):

document.body.onkeydown = 
document.body.onkeyup = 
document.body.onkeypress = function(event) {      
    return false;
};

This prevents one from being able to type normally, but does not stop Command + A key from being processed.

How do to prevent Command + F combination from being processed?

Ideally I would like to be able to prevent only the Command + F combination, as I want to continue using the other Command key combinations.

I have set up a JSFiddle for this question.

like image 651
Michael Robinson Avatar asked Dec 03 '12 05:12

Michael Robinson


1 Answers

It's better to use 'removeCommand' instead of use 'addCommand' with fake handler

editor.commands.removeCommand('find');
like image 69
Andrei Andrushkevich Avatar answered Sep 18 '22 13:09

Andrei Andrushkevich