Add key binding


#1

Hi!

I am trying to bind ‘Alt-C’ : ‘formatCodeblock’ and it’s does not work.
Please help, main.js:

define(function(require, exports, module) {
    'use strict';

    var Extensions = require('ft/core/extensions').Extensions;

    Extensions.addInit(function (editor) {
        editor.addKeyMap({
            'Alt-C' : 'formatCodeblock'
            }
        });
    }, Extensions.PriorityLast);
});

#2

Hi… I think the braces don’t match up in that example. In particular I think you’ve got an extra brace after the Alt-C line. I’ve removed that and this is working for me:

define(function(require, exports, module) {
  'use strict';
  var Extensions = require('ft/core/extensions').Extensions;
  Extensions.addInit(function (editor) {
    editor.addKeyMap({
      'Alt-C' : 'formatCodeblock'
    });
  }, Extensions.PriorityLast);
});