Default keyboard shortcuts stop working after

37 views
Skip to first unread message

leeand00

unread,
Mar 26, 2012, 8:47:02 AM3/26/12
to tiddl...@googlegroups.com
The default keyboard shortcuts for tiddlywiki stop working after I added my own keyboard shortcuts to the plugin code below:

config.macros.addfeaturesplugin.keyDown = function(dasArgs) {
  console.log(dasArgs.keyCode);
  if(dasArgs.keyCode == 91) { /* Start menu button */
     console.log("startmenu key down");
     config.macros.addfeaturesplugin.modifierPressed = true;
  }

  if(config.macros.addfeaturesplugin.modifierPressed && 
     dasArgs.keyCode == 71) { /* g key */
      console.log("g key down");
      config.macros.addfeaturesplugin.bringUpAndEdit();
      config.macros.addfeaturesplugin.modifierPressed = false;

      return true;
   }
  return false;
};

config.macros.addfeaturesplugin.keyUp = function(dasArgs) {
  if(dasArgs.charCode == 91) {
     config.macros.addfeaturesplugin.modifierPressed = false;
  }
};

addEvent(document, "keydown", config.macros.addfeaturesplugin.keyDown);
addEvent(document, "keyup", config.macros.addfeaturesplugin.keyUp);

Is there some other way I should be adding these, so that my keyboard shortcuts are added from my plugin without destroying the existing ones?

Thank you,
   Andrew J. Leer

P.S. How do I donate to Eric from Tiddlywiki?

Måns

unread,
Mar 26, 2012, 9:46:06 AM3/26/12
to TiddlyWiki
Hi Andrew


> P.S. How do I donate to Eric from Tiddlywiki?

http://tiddlytools.com/#Donations

Cheers Måns Mårtensson
Reply all
Reply to author
Forward
0 new messages