Hello I'm trying to register a call back but neither of these ways work:
Thanks in advance
The one you mean is
notepad.callback uses the NOTIFICATION enum, not the SCINTILLANOTIFICATION. But, I expect that's not the notification you wanted - according to the scintilla documentation - (http://www.scintilla.org/ScintillaDoc.html)
Reports all keys pressed but not consumed by Scintilla. Used on GTK+ because of some problems with keyboard focus and is not sent by the Windows version. SCNotification.ch holds the key code and SCNotification.modifiers holds the modifiers. This notification is sent if the modifiers include SCMOD_ALT or SCMOD_CTRL and the key code is less than 256.
So, you'll only get keys that don't have any effect in Scintilla… I'm assuming that's not what you wanted?
Take a look at SCINTILLANOTIFICATION.CHARADDED (SCN_CHARADDED in the Scintilla documentation). Of course without knowing what you're trying to achieve, it's difficult to say :)
Be aware that clearing events is unstable when called from within an event handler in 0.7. This is fixed in 0.8.
Hi Dave, well let me give you an insight of what I i'm trying to do.
I have a py file that holds 2 clases, one for filepositions and filepositioncollection
fileposition collection gets the line # of the bufferid and stores that as a fileposition object, everytime a new line is modified it saves the line #.
what i want to do (which happens in eclipse, and used to happen in npp with changemarkers) is to jump through the lines i've have modified.
since change markers is unstable in current npp…
maybe i should do a script for forward and backward keys, and then set those up as shortcuts, i was thinking of alt+up and alt+down?
Yes, the best way to do this is to create two new scripts, and assign them shortcuts.
Incidentally, Change Markers is only "unstable" if you use Save-All, or "replace in all open documents".
I tried this
console.write("args: " + str(args))
but as I am typing nothing happens.
I'm a brand new n++ python script user - am I overlooking something here?
thanks in advance.
You need to use
editor is the Scintilla object, so anything to do with the text area is normally the editor object. Notepad object is for things like opening and saving files, running menu options and so on. The notepad.callback function also uses the NOTIFICATION enum, not the SCINTILLANOTIFICATION enum.
Also, see http://npppythonscript.sourceforge.net/docs/latest/enums.html?highlight=scintillanotification#SCINTILLANOTIFICATION.CHARADDED for the arguments.
From the docs, it's just a single entry called 'ch', which is an int as to the key that was pressed.
so args will give you 65 if you pressed "A".