TiddlersBarPlugin: keyboard shortcuts

118 views
Skip to first unread message

FND

unread,
Jan 5, 2008, 2:45:52 AM1/5/08
to Tiddl...@googlegroups.com
Pascal,

Would it be possible to introduce keyboard shortcuts for your
TiddlersBarPlugin to switch between tabs?
Since both ALT+TAB and STRG+TAB are taken, how about using the left and
right arrow keys with the browser access key (usually ALT or SHIFT+ALT)?

(Surprisingly, I couldn't find any discussion of this in the group
archives - am I missing anything?)


-- F.

VisualTW

unread,
Jan 5, 2008, 3:08:16 AM1/5/08
to TiddlyWiki
Good idea,

I will look on that. Does somebody knows if there are some embedded
methods in TW to handle keyevent ? Or should I use addeventlistener at
document level ?

Regards
Pascal

FND

unread,
Jan 5, 2008, 6:48:27 AM1/5/08
to Tiddl...@googlegroups.com
> Does somebody knows if there are some embedded
> methods in TW to handle keyevent ?

I only know that there's onTiddlerKeyPress() - but I'm no really
familiar with it.

Glad you're open to the idea though!


-- F.

Eric Shulman

unread,
Jan 5, 2008, 7:50:48 AM1/5/08
to TiddlyWiki
> > Does somebody knows if there are some embedded
> > methods in TW to handle keyevent ?
>
> I only know that there's onTiddlerKeyPress() - but I'm no really
> familiar with it.

This function is NOT a general hook to process keystrokes from any
tiddler.

onTiddlerKeyPress() is intended to add handling for special keys TAB,
ENTER/CTRL-ENTER, ESC, etc. that propagate ("bubble up") to the
tiddler DOM element from text input fields contained within that
tiddler's content, typically defined by the [[EditTemplate]], and
shown only when the tiddler is being edited.

Also, be very careful when writing code that hooks onto the document-
level keystroke event handler. Event handling protocols for different
browsers use different models. For example, IE doesn't like
"onkeypress" handlers.

In addition, "access keys" on different platforms use different
modifier-key combinations (e.g. PC uses ALT-SHIFT-letter, Mac uses
"command"-letter).

Lastly, I think that Bradley Meck wrote a generalized "key binding"
plugin that works cross-platform, and let's you bind alomst any
keystroke (not just "access keys") to almost any function. Sorry, I
don't have the URL at the moment.

HTH,
-e

wolfgang

unread,
Jan 5, 2008, 8:00:26 AM1/5/08
to TiddlyWiki
Hi Eric,

could it be you talk about CaptureKeysMacro? It would be here:

http://tiddlyspot.com/BradleyMeck/#CaptureKeysMacro

W.

Eric Shulman

unread,
Jan 5, 2008, 8:02:31 AM1/5/08
to TiddlyWiki
> could it be you talk about CaptureKeysMacro? It would be here:
> http://tiddlyspot.com/BradleyMeck/#CaptureKeysMacro

Yup! That's the one!

-e

VisualTW

unread,
Jan 5, 2008, 11:37:29 AM1/5/08
to TiddlyWiki
Thanks for all these precious informations ! It seems that
CaptureKeysMacro does the main job. I will try it on tiddlersBar
during the next days and give you some feedback.

Pascal

FND

unread,
Jan 5, 2008, 11:47:17 AM1/5/08
to Tiddl...@googlegroups.com
> It seems that CaptureKeysMacro does the main job.

Actually, CaptureKeysMacro is a huge plugin (~10 kB), and most of its
code is probably not required for this particular purpose.
So, if possible, please only include the crucial portions in
TiddlersBarPlugin - nobody likes bloated plugins... ;)


-- F.

Saq Imtiaz

unread,
Jan 6, 2008, 10:19:10 AM1/6/08
to Tiddl...@googlegroups.com
Pascal,

I don't forsee any real reason why you would need the CaptureKeysMacro. TiddlyWiki has an addEvent method that you should be able to use, to add events to the document in a cross-browser friendly manner.

Hope that helps,

Saq
--
Tiddly Learning ( http://lewcid.org ) : TiddlyWiki news, plugins, themes and educational usage

Eric Shulman

unread,
Jan 6, 2008, 11:05:13 AM1/6/08
to TiddlyWiki
> I don't forsee any real reason why you would need the CaptureKeysMacro.
> TiddlyWiki has an addEvent method that you should be able to use, to add
> events to the document in a cross-browser friendly manner.

unlike regular keyboard events, the browser's implementation of access
key handling can differ between platforms, and access key events may
not always passed to the normal keystroke event handlers (i.e.,
onkeypress, onkeydown, onkeyup).

For example, CTRL-TAB is used by FireFox to switch between tabs. The
browser processes this keystroke AFTER onkeypress, but BEFORE
onkeydown/onkeyup. Thus, to use this keystroke for your own purposes,
you have to handle 'onkeypress' events... BUT... IE doesn't seem to
like 'onkeypress' handling...

also, when you CAN process keystrokes, you may have to account for
cross-platform differences in 'keycode' mappings, as well as I18N
issues such as handling UTF-8 conversion of character values.

In any event (pun intended :-), these are just two examples of how the
keystroke event processing models for different browsers can make this
a non-trivial problem... which is what lead Bradley to write
CaptureKeysPlugin in the first place.

-e

VisualTW

unread,
Jan 7, 2008, 1:44:23 AM1/7/08
to TiddlyWiki
Indeed, key events seems to be a very specific matter (cross browser
and cross platform issues !). So I think, the reasonable way to do the
job is to use CaptureKeysMacro. One other reason is that, if someone
uses key shortcuts, he might uses them for many purposes (vs just tab
switching).

Pascal

VisualTW

unread,
Jan 18, 2008, 10:22:48 AM1/18/08
to TiddlyWiki
Hi all,

The update I put online (version 1.2.5) has two parameters for
switching to the next or previous tab. I did it the simplest way,
using the TW embedded solution (ie createTiddlyButton function
accesskey parameter). So, it works as the standard "alt-shift-n" key
shortcut (that creates a new tiddler).

Regards,
Pascal

On 6 jan, 16:19, "Saq Imtiaz" <lew...@gmail.com> wrote:
> Pascal,
>
> I don't forsee any real reason why you would need the CaptureKeysMacro.
> TiddlyWiki has an addEvent method that you should be able to use, to add
> events to the document in a cross-browser friendly manner.
>
> Hope that helps,
>
> Saq
>
> On Jan 5, 2008 9:08 AM, VisualTW <pascol...@gmail.com> wrote:
>
>
>
>
>
> > Good idea,
>
> > I will look on that. Does somebody knows if there are some embedded
> > methods in TW to handle keyevent ? Or should I use addeventlistener at
> > document level ?
>
> > Regards
> > Pascal
>
> > On 5 jan, 08:45, FND <Ace_No...@gmx.net> wrote:
> > > Pascal,
>
> > > Would it be possible to introduce keyboard shortcuts for your
> > > TiddlersBarPlugin to switch between tabs?
> > > Since both ALT+TAB and STRG+TAB are taken, how about using the left and
> > > right arrow keys with the browser access key (usually ALT or SHIFT+ALT)?
>
> > > (Surprisingly, I couldn't find any discussion of this in the group
> > > archives - am I missing anything?)
>
> > > -- F.
>
> --
> Tiddly Learning (http://lewcid.org) : TiddlyWiki news, plugins, themes and
> educational usage

Albert Riedinger

unread,
Apr 3, 2012, 9:15:25 PM4/3/12
to tiddl...@googlegroups.com, TiddlyWiki
Hi all,

I'm new to TiddlyWiki and this Group as well. It's a bit late to ask questions here as this thread is about 4 years old.
I installed your plugin, but I don't know how to configure the plugin in order to use the shortcut feature to switch between tabs.
I hope that someone could give me a hint.

Kind regards,
Albert
Reply all
Reply to author
Forward
0 new messages