escape key canceling tiddler

15 views
Skip to first unread message

jerimiah

unread,
Nov 1, 2009, 2:37:47 PM11/1/09
to TiddlyWiki
I am using MPTW for taking notes and am amazed with what a great tool
it is.

There is one problem I have yet to resolve on my own:

Several times (usually after typing a huge amount of material, given
Murphy's Law) I have accidentally struck the esc key and lost it all.
I have a subnotebook with a tiny key board and my pinky is only an
inch away from that key most of the time. This is remarkably
frustrating. How is this trait of use to anyone? (Not a rhetorical
question)

What is the most up to date and simple way of dealing with this? I
saw various threads that are quite old. I installed the
TextAreaPlugin, and the DisableEscKey plugin. Before I get into
details of those, is there an easier way to solve this? In the mean
time I
will remap the key to some other place, maybe the other side of the
room (grrrr).

Otherwise this tool has revolutionized how I take notes and learn.
GREAT for people studying medicine (I am in nursing school.) Especial
now that I have discovered the autoweave plugin. Its cool to see
hyperlinks automatically appear, which encourages me to browse my
notes, deepening my understanding ("Oh, this class of drugs works with
the same mechanism of action of these drugs... etc")


Thanks to all,

Jerimiah

jerimiah

unread,
Nov 1, 2009, 2:45:55 PM11/1/09
to TiddlyWiki
OK, I see this from the textAreaPlugin but am no sure how to interpret
it. I looked at the EditTemplate but am lost.

2006.11.16 2.0.0 removed chkDisableEscapeKey (obsolete... use custom
EditTemplate to change toolbar definition). Rewrote focusTiddler as a
HIJACK instead of just overwriting core function (permits other
plugins to also hijack function). Removed TAB character processing
(now built-in as of TW2.1). Merged code from ResizeEditorPlugin:

from the

Eric Shulman

unread,
Nov 1, 2009, 3:39:56 PM11/1/09
to TiddlyWiki
> 2006.11.16 2.0.0 removed chkDisableEscapeKey (obsolete... use custom
> EditTemplate to change toolbar definition).

Much has changed since 2006.... but the basic mechanism for binding
the escape key to a toolbar command is the same: the command is
preceded by a "-" (minus sign). Thus, in ToolbarCommands (or
MPTWTheme if using MPTW), you could change this:

|~EditToolbar|+saveTiddler -cancelTiddler copyTiddler deleteTiddler|

to

|~EditToolbar|+saveTiddler cancelTiddler copyTiddler deleteTiddler|

(i.e. remove the "-" prefix from cancelTiddler)

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

jerimiah

unread,
Nov 2, 2009, 12:15:30 PM11/2/09
to TiddlyWiki
Thank you Eric!

It was actually located in the quoted code below but it did the
trick. Thanks!

!EditTemplate
<!--{{{-->
<div class="toolbar" macro="toolbar +saveTiddler saveCloseTiddler
closeOthers -cancelTiddler cancelCloseTiddler deleteTiddler"></div>
<div class="title" macro="view title"></div>
<div class="editLabel">Title</div><div class="editor" macro="edit
title"></div>
<div macro='annotations'></div>
<div class="editLabel">Content</div><div class="editor" macro="edit
text"></div>
<div class="editLabel">Tags</div><div class="editor" macro="edit
tags"></div>
<div class="editorFooter"><span macro="message
views.editor.tagPrompt"></span><span macro="tagChooser"></span></div>
<!--}}}-->

jerimiah

unread,
Nov 2, 2009, 12:17:00 PM11/2/09
to TiddlyWiki
Question, how is there any reference to the esc key here?

rakugo

unread,
Nov 2, 2009, 12:47:07 PM11/2/09
to TiddlyWiki
The reference is in the EditTemplate code.
In the toolbar you have -cancelTiddler.
The - in this ties the escape key to the command cancelTiddler.
In a similar fashion in +saveTiddler the + command ties the double
mouse button to saveTiddler.
Hope that helps.
Jon

Eric Shulman

unread,
Nov 2, 2009, 2:36:30 PM11/2/09
to TiddlyWiki
> In the toolbar you have -cancelTiddler.
> The - in this ties the escape key to the command cancelTiddler.
> In a similar fashion in +saveTiddler the + command ties the double
> mouse button to saveTiddler.

To be accurate, the "+" prefix binds a command to both a 'double-
click' and a 'ctrl-enter' keystroke, while the "-" prefix binds a
command to an 'escape' keystroke.

When *viewing* a tiddler, double-clicking the tiddler background
triggers the '+editTiddler' command. Note that "ctrl-enter" typically
doesn't do anything when viewing a tiddler because there isn't a
current input field that has the 'focus' so it can process the
keystroke.

Of course, when *editing* a tiddler, there are always input fields
(one of which usually has the focus), so "esc" triggers the "-
cancelTiddler" command and "enter" triggers the "+saveTiddler"
command. Note that double-clicking in the text area is processed by
that text area to select a word in the source content and thus does
not also trigger the "+saveTiddler" command.

jerimiah

unread,
Nov 2, 2009, 9:11:43 PM11/2/09
to TiddlyWiki
That you both for those helpful replies.

Where does one learn this stuff? Should I get a book on Java Script?
The resources I've come across hitherto have been either for complete
beginners or seasoned programmers.

RA

unread,
Nov 20, 2009, 9:33:14 PM11/20/09
to TiddlyWiki
Jerimiah, check out my posting
http://groups.google.com/group/tiddlywiki/t/eaad7711a105f77b

I think I've found the real culprit behind this. Don't turn off "Esc"
key, just make sure it is handled properly.

--R

Simon Baird

unread,
Apr 13, 2010, 8:21:51 AM4/13/10
to tiddl...@googlegroups.com
On Sat, Nov 21, 2009 at 12:33 PM, RA <namea...@gmail.com> wrote:
Jerimiah, check out my posting
http://groups.google.com/group/tiddlywiki/t/eaad7711a105f77b

I think I've found the real culprit behind this. Don't turn off "Esc"
key, just make sure it is handled properly.

--R


Fixed in an upcoming release.

Cheers,

Simon.
 
--
simon...@gmail.com
Reply all
Reply to author
Forward
0 new messages