How to detect keypress in scite editor ? (especially enter key)

155 views
Skip to first unread message

vinod kc

unread,
Oct 25, 2015, 6:00:23 AM10/25/15
to scite-interest
Hi all,
I am using scite for coding autoit and lua. My scite don't add end keywords like"EndIf, Next, Until" automatically. So i have decided to add this feature. So each time user presses enter, this function will check for the keywords like "If, For". If found any, then it will add two lines to scite and in the 2nd line it will paste the appropriate end keyword. So i need to detect the keypress. Plus that, please tell me where to put this function. Thanks in advance.

Neil Hodgson

unread,
Oct 26, 2015, 12:35:21 AM10/26/15
to scite-i...@googlegroups.com
vinod kc:

So i need to detect the keypress.

   Define a function in the Lua startup script called OnChar or OnKey as described on

   Neil

johnsonj

unread,
Oct 26, 2015, 3:53:47 AM10/26/15
to scite-interest
If you intend the concepts for 'hotkey' and 'hotstring' of autoit,
SciTE has already those mechanisms as abbreviation (as well as autocompletion and calltip).


"""So each time user presses enter, this function will check for the keywords like "If, For". If found any, then it will add two lines to scite and in the 2nd line it will paste the appropriate end keyword."""

If you use SciTEforAutoit, see au3abbrev.properties which has a collection of abbreviations.
and Try Ctrl+b instead of Enter.

If otherwise I got you wrong, you may invent your own wheel. good luck!
Reply all
Reply to author
Forward
0 new messages