I am playing with keyboard shortcuts. attached there are two tiddlers. 
 
*Test 01: Works fine*

Drag and drop the Keyboard_01.tid into https://tiddlywiki.com/prerelease

click on the orange box and then use left right arrow keys and see how the 
number changes inside orange box.

*Keyboard/01*
\define addup()      <$action-setfield $tiddler=TempTid text={{{ 
[[TempTid]get[text]add[1]]~[[1]] }}}      />
\define reducedown() <$action-setfield $tiddler=TempTid text={{{ 
[[TempTid]get[text]subtract[1]]~[[0]] }}} />

<$keyboard key="right" actions=<<addup>>>
<$keyboard key="left" actions=<<reducedown>>>

<div tabindex=100 style="border:1px solid orange;">

!! Display me

Temp value: {{TempTid}}
</div>
</$keyboard>
</$keyboard>



*Test 02: Focus is lost*
Drag  and drop the Keyboard_02.tid into https://tiddlywiki.com/prerelease

click on the orange box and use left right arrows and see title appears 
inside orange box

*Keyboard/02*
\define stateTid()  state-tiddler
\define myTag()     HelloThere


\define next()     <$action-setfield $tiddler=<<stateTid>> text={{{ 
[tag<myTag>after<currentTid>]  ~[tag<myTag>first[]]}}}     />
\define previous() <$action-setfield $tiddler=<<stateTid>> text={{{ 
[tag<myTag>before[$(currentTid)$]] ~[tag<myTag>last[]]  }}}     />

<$wikify name=currentTid text={{{ [<stateTid>get[text]] }}}>
<$keyboard key="right" actions=<<next>> >
<$keyboard key="left"  actions=<<previous>> >
<div style="border:2px solid orange; padding:5px; min-height:128px" 
tabindex=1>

* Current tid:  <<currentTid>>


</div>
</$keyboard>
</$keyboard>
</$wikify>


What is the reason? I have to click on the orange box after every 
Right/Left arrow keys pressed, because the focus is lost.

Ultimate purpose: Transclude a tiddler from a list and step through using 
Left/Right arrow keys.

--Mohammad





-- 
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/cd34bb09-b8a0-4a07-b91a-fb6e44575eb7n%40googlegroups.com.

<<attachment: Keyboard_tiddlers.zip>>

Reply via email to