7

I want add 'Alt-Space' key map to codemirror and then perform a particular function when the keys are pressed. I am not able to add this keymap using .

cm.addKeyMap

Where should I be writing this function so that the key map can be bound to a particular function?

adityazoso
  • 514
  • 5
  • 15

1 Answers1

14

What is the exact code you are using?

For your information, you can always add any keyMap to the editor instance by the following lines of code :

var map = {"Alt-Space": function(cm){...}}
editor.addKeyMap(map);

where, editor is the CodeMirror instance.

djadmin
  • 1,742
  • 3
  • 19
  • 27