lintalist icon indicating copy to clipboard operation
lintalist copied to clipboard

Add Support for Combination Send Keys or Send Raw Keys in Plugin [[C=]]

Open starstuff opened this issue 10 years ago • 3 comments

Hello!

I'm using Lintalist combined with a desktop wiki Zim Desktop Wiki to quickly create different templates like notes, research, idea.

Everything is working except for the conversion of Headings, you can create headings using ==headings then (enter key) , this depends on the (=) signs or by shortcut Ctrl+1 to 5

I tried using the plugin [[C=]] and all the 4 send keys options but its not working inside zim desktop wiki. but if i go back and press Enter key manually it will turn into a heading

snippet ==HeadingTopic [[C=\n]]

result ==HeadingTopic (in text form not converted to a heading)

I know its not the snippet because if i use it in notepad, it works as expected, although not converting the headings but the enter key is executed. i used this

snippet ==HeadingTopic [[C=\n|5]]

resullt ==HeadingTopic (with five new line)

The added support for combination keys will be something like this, i dont know if it will work though

snippet HeadingTopic [[C=Ctrl+1]]

and the Send Raw key support could work also, but im not so sure.

you can try it using the portable version in the windows build

official link: http://zim-wiki.org/ windows build: www.glump.net/software/zim-windows

Thank you!

starstuff avatar Jan 07 '16 03:01 starstuff

Hello @starstuff, thank you for your feedback.

I just tried it with Zim Desktop Wiki and see what you mean. If you type enter after the ==HeadingTopic it will transform it to a Wiki heading, but if you paste the enter it just remains text.

I can see how a send plugin could be a useful addition and I will think about how to best implement it. (If there is news about this I'll post it here so you should get a notification, might be a while)

But you can already achieve what you want if you move your Snippet to the Script section, edit the HeadingTopic snippet and paste these three lines in the Script section of the Snippet

SendMode, Input 
SetKeyDelay, -1
Send, ==HeadingTopic{enter}

like so

lintalist snippet editor

The first two lines (SendMode and SetKeyDelay) are not required but will make it run faster and more reliable.

To send ctrl+1 you can use ^1 like so Send, ==HeadingTopic^1

HTH.

lintalist avatar Jan 07 '16 19:01 lintalist

Thank you HTH for considering the idea!

I tested the script snippet and working like someone is typing it for you!

script snippet:

SendMode, Input SetKeyDelay, -1 Send, ====tags: {enter} Send, ====links: {enter} Send, {enter} Send, {enter} Send, ===Administrative {enter} Send, {enter} Send, {enter} Send, ===Content {enter} Send, {enter} Send, {enter} Send, ====Primary {enter} Send, {enter} Send, {enter} Send, ====Seconad-Level {enter} Send, {enter} Send, {enter} Send, ====Third-Level {enter} Send, {enter} Send, {enter} Send, ====Fourth-Level {enter} Send, {enter} Send, {enter} Send, ===eof {enter}

source: http://calnewport.com/blog/2009/05/11/how-to-build-a-paper-research-wiki/

looking forward to the implementation of send plugin, the script is a bit slow compared to the text snippet.

I will share this to the zim community!

Thank you again!

starstuff avatar Jan 10 '16 01:01 starstuff

Update: with v1.9.3 the above script can be replaced with the snippet + script. Makes it easier to maintain the snippets.

Part1:

====tags: 
====links: 


===Administrative 


===Content 


====Primary 


====Seconad-Level 


====Third-Level 


====Fourth-Level 


===eof 


Script:

#NoEnv
SetBatchLines, -1
SendMode, Input
[[llpart1]]
Send, % llpart1

lintalist avatar Nov 25 '17 17:11 lintalist