AkelPad Forum Index AkelPad
Support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to add a new line when double clicked at end-of-line?

 
Post new topic   Reply to topic    AkelPad Forum Index -> Discussion (English)
View previous topic :: View next topic  
Author Message
TiderV



Joined: 14 Oct 2017
Posts: 3

PostPosted: Sat Oct 14, 2017 8:27 am    Post subject: How to add a new line when double clicked at end-of-line? Reply with quote

I am using akelpad ver 4.9.8(X64), sometimes I pick some text and paste to akelpad for later reference, during this process no keyboard manipulation should be required, but it's an annoyance that I have to manually press enter for each line I pasted, so I hope to find a way to automatically add a new line when I double click the mouse at end of line. I think the function should work in this way:

1. Triggered by double click at the end of line or at the end of file
2. If double clicked at the end of one line ,automatically add a new line under that line,and If there is a blank line available under the line triggered double click , no action should be performed.
3. Automatically add gieven number of new lines when mouse double clicked at end of file, and If there are a preset number of blank lines available at end of file ,no action should be performed.
4. After these processes,the caret keeps stay at the position where it clicked.

I have no idea on how to make this script,can anyone give me some help?
Back to top
View user's profile Send private message
opk44



Joined: 16 Jan 2010
Posts: 615

PostPosted: Sat Oct 14, 2017 2:55 pm    Post subject: Re: How to add a new line when double clicked at end-of-line Reply with quote

TiderV wrote:
I have no idea on how to make this script,can anyone give me some help?

Why not simplify the problem?
Instead, you can use a script that simulates pressing the {ENTER} and {LEFT}
Code:
var WshShell=new ActiveXObject("WScript.shell");

WshShell.SendKeys("{ENTER}{LEFT}");

Add this script on ToolBar:
Code:
-"Add one New Line"  Call("Scripts::Main", 1, "YourScriptName.js") Icon(14)

Or/And in ContextMenu:
Code:
-"Add one New Line"  Call("Scripts::Main", 1, "YourScriptName.js") Icon(4)
Back to top
View user's profile Send private message
TiderV



Joined: 14 Oct 2017
Posts: 3

PostPosted: Sat Oct 14, 2017 5:17 pm    Post subject: Reply with quote

Thanks a lot for your detailed explanation opk44 , this is a solution ,but it does'n simplify my workflow. I'd rather to use ahk if I need to simulate a key press , I have an ahk based mouse gesture working in background .
What I need is a line-adding in certain condition,for I know little about the akelped script architecture,I need to know more about the following problem:
1. How to catch an event of double click in akelpad?
2. How to detect that the caret position be double clicked is at end of line(file)?
3. How to write a function in responding the event?
4. How to silently add new line and instantly refresh the view without alerting caret position?
5. how to know the number of blank line under the current caret position?
...
currently ,I have no information about these problems, can you(or anyone else) give some more explanation?
thanks a million!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AkelPad Forum Index -> Discussion (English) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


SourceForge.net Logo Powered by phpBB © 2001, 2005 phpBB Group