Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2007-12-05 06:24:16

kalle
New member
Registered: 2007-11-12
Posts: 4

deactivate shortcuts

is there a method to deactivate some shortcuts? or what else would you advise me to do?

Offline

#2 2007-12-12 17:59:24

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

Re: deactivate shortcuts

At the moment there's no simple way to do that.

If you know some JavaScript you could do it by overwriting Xinha.prototype._shortCuts. This is the original function for a start. You can edit it to fit your needs and load the edited code at some point after XinhaCore.js

Xinha.prototype._shortCuts = function (ev)
{
  var key = this.getKey(ev).toLowerCase();
  var cmd = null;
  var value = null;
  switch (key)
  {
    // simple key commands follow

    case 'b': cmd = "bold"; break;
    case 'i': cmd = "italic"; break;
    case 'u': cmd = "underline"; break;
    case 's': cmd = "strikethrough"; break;
    case 'l': cmd = "justifyleft"; break;
    case 'e': cmd = "justifycenter"; break;
    case 'r': cmd = "justifyright"; break;
    case 'j': cmd = "justifyfull"; break;
    case 'z': cmd = "undo"; break;
    case 'y': cmd = "redo"; break;
    case 'v': cmd = "paste"; break;
    case 'n':
    cmd = "formatblock";
    value = "p";
    break;

    case '0': cmd = "killword"; break;

    // headings
    case '1':
    case '2':
    case '3':
    case '4':
    case '5':
    case '6':
    cmd = "formatblock";
    value = "h" + key;
    break;
  }
  if ( cmd )
  {
    // execute simple command
    this.execCommand(cmd, false, value);
    Xinha._stopEvent(ev);
  }
};

Be aware, though, that this -- like any "hack" -- after an update could stop working and in any case hinders any improvements made in this function (which are actually likely to  happen some time in the future, as the shortcut handling definitively is too unflexible)

Offline

#3 2007-12-13 11:10:37

kalle
New member
Registered: 2007-11-12
Posts: 4

Re: deactivate shortcuts

ok. thank you very much

Offline

Board footer

Powered by FluxBB