what's the keyboard shortcut for new tiddler???

473 views
Skip to first unread message

kelsang sherab

unread,
May 12, 2018, 5:19:29 PM5/12/18
to TiddlyWiki
is there a keyboard shortcut for new tiddler?

Sebastián Ortega

unread,
May 13, 2018, 5:36:37 AM5/13/18
to TiddlyWiki
If not, is there any way to set it up one?

BurningTreeC

unread,
May 13, 2018, 8:50:17 AM5/13/18
to TiddlyWiki
At the moment there are no keyboard shortcuts besides the ones you can define using the keyboard widget, but they only work within a textarea or an input field

I made a pull request for keyboard shortcuts today using the "accesskey" attribute (see here: https://www.w3schools.com/tags/att_global_accesskey.asp) on buttons. That would let you define a keyboard key, that triggers the new-tiddler button when you press that key in combination with the key that's defined in your browser for accessing access-keys.

I already have it working in a testing wiki and it works really fine. Buttons must be visible to be able to access them or - like in the sidebar by the "retain" attribute of the reveal widget - only hidden visually. That means, if the sidebar is closed one can still access the page-control buttons with an access-key.

If you want to try this out, it's only a small tweak


best wishes, BTC

kelsang sherab

unread,
May 13, 2018, 9:48:27 AM5/13/18
to TiddlyWiki
I would not mind trying this except I haven no techniacl knowledge of how to make it

thanks

BurningTreeC

unread,
May 13, 2018, 10:00:22 AM5/13/18
to TiddlyWiki
you can simply import the three files here at the bottom, then save your wiki and reload it. Try it with an empty wiki first


if you want to add keys to other buttons, you can open the button tiddler (for example $:/core/ui/Buttons/new-journal) and add "accessKey={{$:/config/accessKey/new-journal}}" to the <$button ... message="..." class="..." accessKey={{$:/config/accessKey/new-journal}}>.... ... </$button>
change new-journal accordingly to the name of the button you're editing
$__config_accessKey_new-tiddler.json
$__core_ui_Buttons_new-tiddler.json
$__core_modules_widgets_button.js.json

BurningTreeC

unread,
May 13, 2018, 10:15:01 AM5/13/18
to TiddlyWiki
... then create a tiddler "$:/config/accessKey/new-journal" and put your desired accesskey in the text field, like j

On most browsers the key can be accessed by holding "Alt" and pressing the key
On firefox it seems that that key can be configured - try "Alt" or "Alt+Shift" or "Ctrl+Alt" plus the defined key
If that doesn't work on firefox, it's either something that can be configured - or a bug.


BurningTreeC

unread,
May 13, 2018, 11:19:55 AM5/13/18
to TiddlyWiki
I've figured out that on firefox-esr it works out of the box, on the newest firefox it may need some tuning.

If it doesn't work, one can try to open "about:config" in a new tab, then "accept the risks", then search for "chromeaccess" - only one entry should remain. double-click that entry and set it to 18. Then Alt+Shift+key should work

Mohammad

unread,
May 13, 2018, 12:14:02 PM5/13/18
to TiddlyWiki
Many thanks!
 Shortcut keys are very important specially when you use TW for presentation.

Right now TW is heavily depend on mouse clicks.

I hope Jeremy respond to this pull request soon!

/Best

BurningTreeC

unread,
May 13, 2018, 12:15:25 PM5/13/18
to TiddlyWiki
@Mohammad , you're welcome!

let me know if it works for you

BTC

Mohammad

unread,
May 13, 2018, 12:29:44 PM5/13/18
to TiddlyWiki
@BTC
 I use TiddlyDesktop and it works for me!
I just tried Alt+n and it creates a new Tiddler

One question
 I use Zoomin storyview with one tiddler at a time on screen. I have added two small buttons at the bottom of tiddler to let me navigate to
next/previous tiddler in the storyriver.
Is it possible to use your method to add Spacebar key for next or arrow keys or page Up/Down keys for Next/Previous
tiddler.


Cheers
Mohammad

Mohammad

unread,
May 13, 2018, 12:30:34 PM5/13/18
to TiddlyWiki
@BTC
 You can have a look at

Best

BurningTreeC

unread,
May 13, 2018, 12:38:35 PM5/13/18
to TiddlyWiki
It can be used with every button

  • open the tiddler where the button is
  • look for the <$button ...>
  • make it <$button ... accesskey="u">
  • or make it <$button ... accesskey={{$:/config/accessKey/mybutton}}> and create the tiddler $:/config/accessKey/mybutton and put "u" in the text field (or your key)
  • that's all, using Alt+yourkey triggers the button as if it was clicked
I tried space, it works if you add accesskey=" " or if you put a space in your config tiddler (no " " in the config tiddler, just a space)

Mohammad

unread,
May 13, 2018, 12:53:06 PM5/13/18
to TiddlyWiki
Let me to try that.

Cheers
Mohammad

kelsang sherab

unread,
May 13, 2018, 2:59:15 PM5/13/18
to TiddlyWiki
@Mohammad
That's a great  little sight!!
Message has been deleted

BurningTreeC

unread,
May 13, 2018, 3:36:42 PM5/13/18
to TiddlyWiki
Hi, as I explained in my 5th post:

after importing, save the wiki and reload it. Changing the access key would also need to save and reload.
the key defined in $:/config/accessKey/new-tiddler then is the key to use with your browser's defined key for accessing access-keys. On chrome it's "Alt" - on firefox-esr it's "Alt+Shift" ... plus the defined key

if you're using a new firefox it may need a config change, I tried it and had to change something to make access-keys work. Normally it should be supported by all browsers

kelsang sherab

unread,
May 13, 2018, 3:41:32 PM5/13/18
to TiddlyWiki
do I need to give a special tag to this "$:/config/accessKey/new-journal   tiddler?

BurningTreeC

unread,
May 13, 2018, 3:54:44 PM5/13/18
to TiddlyWiki
do I need to give a special tag to this "$:/config/accessKey/new-journal   tiddler?


No, you only need to edit $:/core/ui/Buttons/new-journal and change the <$button ...> to <$button ... accessKey={{$:/config/accessKey/new-journal}}> if it's not already there
also, to be able to access the new-journal button it must be visible in the sidebar on top below the site title and site subtitle (in the sidebar - tools - check the checkbox for new journal)

Mohammad

unread,
May 14, 2018, 1:58:23 PM5/14/18
to TiddlyWiki
@BurningThreeC

I checked the accessKey in Wizrd-Wizrd Demo by Jed and it works, but the drawback is it does not support the arrow keys or page+Up/Down.

There are some small JavaScript library for shortcut keys, is there any way to import such library in TiddlyWiki?

/Best

Mohammad

unread,
May 14, 2018, 2:10:53 PM5/14/18
to TiddlyWiki
I may propose to have a plugin as shortcut keys
some library available to be used are:

PMario

unread,
May 14, 2018, 2:56:08 PM5/14/18
to TiddlyWiki
On Monday, May 14, 2018 at 7:58:23 PM UTC+2, Mohammad wrote:
 
There are some small JavaScript library for shortcut keys, is there any way to import such library in TiddlyWiki?

It's not trivial.

The biggest problem is, that we use transclusions everywhere. ... eg: If you dynamically create buttons, that have keys assigned, they can be created several times. .. So it's hard to decide (for a program), which button should be triggered ...

TiddlyWiki has an existing key-handling mechanism. We are currently exploring the possibilities. see: https://github.com/Jermolene/TiddlyWiki5/pull/3273

-m

Mohammad

unread,
May 14, 2018, 9:43:01 PM5/14/18
to TiddlyWiki
Thanks Pmario
I read the pull request and discussions there.
One question, it seems support for accesskey will be dropped for HTML5 standard, also different browsers react differently to accesskey, so don't you think a JavaScript solution maybe be a better solution in long time?

Mohammad

unread,
May 14, 2018, 11:10:15 PM5/14/18
to TiddlyWiki
@PMario,
 Could this mechanism possible to be used in zoomin storyview?
In that case, we have only one tiddler visible at a time, the problem is only with tranclusion!

/Mohammad

PMario

unread,
May 15, 2018, 3:25:13 AM5/15/18
to TiddlyWiki
On Tuesday, May 15, 2018 at 3:43:01 AM UTC+2, Mohammad wrote:
One question, it seems support for accesskey will be dropped for HTML5 standard,

That's not true. TiddlyWiki has keyboard handling functions. But implementing key-handling libraries is only 20% of the work, that has to be done. ... JavaScript libraries are only useful for "core" or plugin developers.

In TiddlyWiki we need the possibility to provide this functionality for "advanced users" in wikitext, using widgets.

 - We have the keyboard-widget, which allows advanced users to deal with shortcuts.
     see: EditTemplate and several others
- The keyboard-widget maps shortcuts to tiddlywiki actions. using action-widgets
 - and so on. ...

For most "pages" keyboard handling is simple, because they dispaly "static" content, with a hand full of input elements. Those pages are created by developers. The users are "locked in" to be "consumers" and can fill forms, that sombody else statically defined ....

In TW we have a highly dynamic UI, that can be modified by "end-users", to be able to be "content producers". There is no limit how many "forms" (tiddlers in edit mode) are open at the same time. ... That's a big difference!
 
also different browsers react differently to accesskey,

It's not only different browsers. .. It's also different OSes that have sligtly different approaches and implementations. eg: Ctrl-key, Cmd-Key and Alt-Key .. That's why TW "$:/ControlPanel: Kayboard Shortcuts" tab allows us to configure every OS separately if needed.

There are some common shortcuts, everyone knows, that can't be used in browser-apps, since the browser catches them. No matter what you do! eg: Ctrl-S, Ctrl-N ....
 
so don't you think a JavaScript solution maybe be a better solution in long time?

That's right. We already use one ... But as I wrote, that's only part of the game. We need to find ways to make it availalbe for our "wikitext-users", with consistency and acceptable complexity.

The proposed pull-request may be only the first step, to get more flexibility.

Everyone is welcome to add comments to the discussion.

have fun!
mario



Jeremy Ruston

unread,
May 15, 2018, 3:35:05 AM5/15/18
to tiddl...@googlegroups.com
The motivation for adding the accessKey attribute to the button and link widgets is that it is a standard HTML5 feature, and we're just passing the attribute through. (I can't find any references to the attribute being dropped from the standard).

The differences between browsers are sufficiently frustrating that I don't propose to use the accessKey attribute in the core UI. If we want global keyboard shortcuts we'll need to do it properly: a new startup module that listens to key events on the document, reusing the existing keyboard shortcuts pane in the control panel.

Best wishes

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/22a23cf5-5adb-4b9c-a34c-a9100dc970f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

@TiddlyTweeter

unread,
May 15, 2018, 5:38:37 AM5/15/18
to TiddlyWiki
Ciao Jeremy & all


Jeremy Ruston wrote:
The differences between browsers are sufficiently frustrating that I don't propose to use the accessKey attribute in the core UI. If we want global keyboard shortcuts we'll need to do it properly: a new startup module that listens to key events on the document, reusing the existing keyboard shortcuts pane in the control panel.

Right.

My interest in this is also partly TiddlyDesktop related ("Theme: Make More Like A Browser but without making it one") . IMO its much better to have a universal way forward with key-combos. In addition it could maybe overcome some of the small limitations in TiddlyDesktop (not being a browser per se, just using a core Chrome engine, lacks both Chrome Browser keys and right-click options) in a manageable way.

Best wishes
Josiah

Mohammad

unread,
May 15, 2018, 10:47:10 PM5/15/18
to TiddlyWiki
Hi Jeremy,
 Yes, you right! My reference was wrong and from https://www.w3.org/TR/html52/ I learned the support is available in HTML5!
Sorry for inconvenience!

Best
Mohammad

Mohammad

unread,
May 15, 2018, 10:50:53 PM5/15/18
to TiddlyWiki
Thank you Mario for clarification and the useful information!
It seems it is not a tough work for an advanced user to assign shortcuts for a plugin and like that.
/Mohammad

kelsang sherab

unread,
May 17, 2018, 12:05:45 PM5/17/18
to TiddlyWiki
forgot to say thank you!!

BurningTreeC

unread,
May 17, 2018, 12:33:15 PM5/17/18
to TiddlyWiki
forgot to say thank you!!

thanks, you're welcome!

FYI: we've now started to add global keyboard shortcuts to tiddlywiki here , which would make this solution with the accesskeys unnecessary because it just works better.
I hope it will be reviewable on the tiddlywiki prerelease page anytime soon
until then, the accesskey-solution is the best we have

all the best, BTC
Reply all
Reply to author
Forward
0 new messages