[tw5] Re: Keystroke to Close Current Tiddler in TW5

2021-08-31 Thread
Hi there,

Reviving this thread to point out 
that https://github.com/MaxGyver83/tw5-keyboard-navigation works really 
well. The shorcuts are hardcoded but apart from that, it's great. Now only 
missing the "Close other tiddlers" ("all but FocusTiddler") action!

Best,
R²

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/7d30388d-4061-47e6-bd52-b421740b1b79n%40googlegroups.com.


[tw5] Re: Keystroke to Close Current Tiddler in TW5

2019-01-22 Thread Gabriel Chen
Hi Kevin, 

I was looking for the same solution for a while and found something... 
emmm, sort of cheating. 

   1. My TiddlyWiki story view is "Zoom In", so there is only one tiddler 
   surfaced at one time;
   2. I noticed the tiddler close button [X] always appears at a fix 
   position (X1415, Y220 on my screen), if the tiddler is short (i.e. no 
   scrolling of the window); 
   3. If the tiddler is long, when [Home] key is pressed, the [X] appears 
   are the same position;
   4. AutoHotKey  can be used to send 
   virtual  keystroke and mouse operation (e.g. move the cursor to somewhere 
   and click);
   5. Hence the idea is: once a keystroke (i.e. "Alt + X") is pressed > 
   trigger a piece of AutoHotKey script > Send [Home] key > Move cursor to [X] 
   position > left click

Here is the script, I am using "control + space bar" to fire it: 
; Comment: Use to close tiddler in tiddlywiki
; Comment: Uses [ctrl] + [space] to trigger 
^Space::
SendInput, {Home}
Sleep, 200   ; wait for 0.2s, the page goes up
MouseClick, left, 1415, 220 ;[X] button position in px on the screen
return 


Used commands 

   - SendInput 
   - Sleep 
   - MouseClick 
   
revise "^Space" to your preferred key combination: 

   - 
   - ; ! = Alt
   - ; ^ = Control
   - ; + = Shift
   - ; # = WindowsKey
   - ; other example: [Ctrl] + [Shift] + [a] = ^+a

Hope it helps. ;-) 

On Sunday, April 8, 2018 at 8:49:36 AM UTC+8, Kevin Kleinfelter wrote:
>
> 99% of the way there.  In addition to what I said before:
>
>- I added tabindex="1" to the div in ViewTemplate.  This makes it 
>possible to select a view-mode tiddler.
>- I wrapped the div with: <$keyboard key="alt-W" 
>message="tm-close-tiddler">
>
> I also had to edit $:/config/Search/AutoFocus (shadow tiddler) and set it 
> to: false
>
> I'm still not there.  Focus often winds up on the document body. 
>  (Verified via running some JavaScript in the browser console.)
>
> I need to add an onFocus to the body, which does a setFocus to the first 
> story div.  The only way I know to do that would be to edit 
> $:/core/templates/tiddlywiki5.html 
>  .
>
> Can anyone suggest a "tiddlywiki style" way to shift focus from the 
> document body to the first story in the river?
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@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/b5dac02c-33e1-4ff4-91af-5c633f1acd06%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Keystroke to Close Current Tiddler in TW5

2018-04-07 Thread Kevin Kleinfelter
99% of the way there.  In addition to what I said before:

   - I added tabindex="1" to the div in ViewTemplate.  This makes it 
   possible to select a view-mode tiddler.
   - I wrapped the div with: <$keyboard key="alt-W" 
   message="tm-close-tiddler">

I also had to edit $:/config/Search/AutoFocus (shadow tiddler) and set it 
to: false

I'm still not there.  Focus often winds up on the document body.  (Verified 
via running some JavaScript in the browser console.)

I need to add an onFocus to the body, which does a setFocus to the first 
story div.  The only way I know to do that would be to edit 
$:/core/templates/tiddlywiki5.html 
 .

Can anyone suggest a "tiddlywiki style" way to shift focus from the 
document body to the first story in the river?

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@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/698630ac-589f-4cb8-81eb-3633985d4d57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Keystroke to Close Current Tiddler in TW5

2018-04-07 Thread Kevin Kleinfelter
Almost a year later, and I'm most of the way to a keystroke to close the 
current view-mode tiddler.


   - I added tabindex="1" to the div in ViewTemplate.  This makes it 
   possible to select a view-mode tiddler.
   - I wrapped the div with: <$keyboard key="alt-W" 
   message="tm-close-tiddler">

With a story river full of view-mode tiddlers, I can tab among tiddlers and 
press alt-W to close the selected tiddlers.

When I navigate to a tiddler, I'd like to automatically set focus to it.  
I'd like it if clicking on a link to a tiddler not only opened/scrolled to 
it, it would set focus to that tiddler.  I don't care so much about 
scrolling, because I typically operate in zoomin mode.  

Now that I've given it a tabindex, is there a way I can set focus to the 
currently zoomed tiddler when it zooms?

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@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/b78f625b-11a2-46f0-8f0b-70c1c01c9c38%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.