On 31 January 2011 12:15, Todd Chambery <todd.chambery@gmail.com> wrote:
Just browsing the Notepad++ code, it looks like this is the method to update Scintilla's mappings:

void ScintillaAccelerator::updateKeys() 
{
NppParameters *pNppParam = NppParameters::getInstance();
vector<ScintillaKeyMap> & map = pNppParam->getScintillaKeyList();
size_t mapSize = map.size();
size_t index;

for(int i = 0; i < _nrScintillas; i++)
{
::SendMessage(_vScintillas[i], SCI_CLEARALLCMDKEYS, 0, 0);
for(size_t j = mapSize - 1; j >= 0; j--) //reverse order, top of the list has highest priority
{
ScintillaKeyMap skm = map[j];
if (skm.isEnabled()) 
{ //no validating, scintilla accepts more keys
size_t size = skm.getSize();
for(index = 0; index < size; index++)
::SendMessage(_vScintillas[i], SCI_ASSIGNCMDKEY, skm.toKeyDef(index), skm.getScintillaKeyID());
}
if (skm.getMenuCmdID() != 0) 
{
updateMenuItemByID(skm, skm.getMenuCmdID());
}
if (j == 0) //j is unsigned, so default method doesnt work
break;
}
}
}

where they send a map of Scintilla key codes to each of the buffers?

Yes, Geany has a binding for sending the SCI_ASSIGNCMDKEY message but it isn't used anywhere.  All you need to do is write code to read the settings and shove them into Scintilla.


Here is my Scintilla config from Notepad++:

    <ScintillaKeys>
        <ScintKey ScintID="2302" menuCmdID="0" Ctrl="yes" Alt="yes" Shift="no" Key="73">
            <NextKey Ctrl="yes" Alt="no" Shift="no" Key="73" />
        </ScintKey>
        <ScintKey ScintID="2300" menuCmdID="0" Ctrl="yes" Alt="yes" Shift="no" Key="75">
            <NextKey Ctrl="yes" Alt="no" Shift="no" Key="75" />
        </ScintKey>
        <ScintKey ScintID="2308" menuCmdID="0" Ctrl="yes" Alt="no" Shift="no" Key="37">
            <NextKey Ctrl="yes" Alt="yes" Shift="no" Key="74" />
        </ScintKey>
        <ScintKey ScintID="2310" menuCmdID="0" Ctrl="yes" Alt="no" Shift="no" Key="39">
            <NextKey Ctrl="yes" Alt="yes" Shift="no" Key="76" />
        </ScintKey>
        <ScintKey ScintID="2307" menuCmdID="0" Ctrl="no" Alt="no" Shift="yes" Key="39">
            <NextKey Ctrl="yes" Alt="no" Shift="yes" Key="76" />
        </ScintKey>
        <ScintKey ScintID="2337" menuCmdID="0" Ctrl="no" Alt="no" Shift="no" Key="0" />
        <ScintKey ScintID="2338" menuCmdID="0" Ctrl="yes" Alt="no" Shift="no" Key="69" />
        <ScintKey ScintID="2304" menuCmdID="0" Ctrl="no" Alt="no" Shift="no" Key="37">
            <NextKey Ctrl="yes" Alt="no" Shift="no" Key="74" />
        </ScintKey>
        <ScintKey ScintID="2453" menuCmdID="0" Ctrl="no" Alt="no" Shift="no" Key="36">
            <NextKey Ctrl="yes" Alt="no" Shift="no" Key="72" />
        </ScintKey>
        <ScintKey ScintID="2451" menuCmdID="0" Ctrl="no" Alt="no" Shift="no" Key="35">
            <NextKey Ctrl="yes" Alt="no" Shift="no" Key="186" />
        </ScintKey>
        <ScintKey ScintID="2180" menuCmdID="42006" Ctrl="no" Alt="no" Shift="no" Key="46">
            <NextKey Ctrl="yes" Alt="no" Shift="no" Key="68" />
        </ScintKey>
        <ScintKey ScintID="2442" menuCmdID="0" Ctrl="yes" Alt="no" Shift="yes" Key="0" />
        <ScintKey ScintID="2311" menuCmdID="0" Ctrl="yes" Alt="yes" Shift="yes" Key="76">
            <NextKey Ctrl="yes" Alt="no" Shift="yes" Key="39" />
        </ScintKey>
        <ScintKey ScintID="2301" menuCmdID="0" Ctrl="yes" Alt="no" Shift="yes" Key="75">
            <NextKey Ctrl="yes" Alt="yes" Shift="yes" Key="75" />
        </ScintKey>
        <ScintKey ScintID="2303" menuCmdID="0" Ctrl="yes" Alt="no" Shift="yes" Key="73">
            <NextKey Ctrl="yes" Alt="yes" Shift="yes" Key="73" />
        </ScintKey>
        <ScintKey ScintID="2309" menuCmdID="0" Ctrl="yes" Alt="no" Shift="yes" Key="37">
            <NextKey Ctrl="yes" Alt="yes" Shift="yes" Key="74" />
        </ScintKey>
        <ScintKey ScintID="2315" menuCmdID="0" Ctrl="yes" Alt="no" Shift="yes" Key="186">
            <NextKey Ctrl="yes" Alt="yes" Shift="yes" Key="186" />
        </ScintKey>
        <ScintKey ScintID="2332" menuCmdID="0" Ctrl="no" Alt="no" Shift="yes" Key="36">
            <NextKey Ctrl="yes" Alt="no" Shift="yes" Key="72" />
        </ScintKey>
        <ScintKey ScintID="2306" menuCmdID="0" Ctrl="no" Alt="no" Shift="no" Key="39">
            <NextKey Ctrl="yes" Alt="no" Shift="no" Key="76" />
        </ScintKey>
        <ScintKey ScintID="2312" menuCmdID="0" Ctrl="yes" Alt="no" Shift="no" Key="72">
            <NextKey Ctrl="yes" Alt="yes" Shift="no" Key="72" />
        </ScintKey>
        <ScintKey ScintID="2313" menuCmdID="0" Ctrl="yes" Alt="no" Shift="yes" Key="72">
            <NextKey Ctrl="yes" Alt="yes" Shift="yes" Key="72" />
        </ScintKey>
        <ScintKey ScintID="2314" menuCmdID="0" Ctrl="yes" Alt="no" Shift="no" Key="186">
            <NextKey Ctrl="yes" Alt="yes" Shift="no" Key="186" />
        </ScintKey>
        <ScintKey ScintID="2305" menuCmdID="0" Ctrl="no" Alt="no" Shift="yes" Key="37">
            <NextKey Ctrl="yes" Alt="no" Shift="yes" Key="74" />
        </ScintKey>
    </ScintillaKeys>

Do the ScintIDs look familiar?

Just guessing what the XML means, but Ids look ok, see Geany source sciltilla/include/Scintilla.h

To be compatible with the rest of Geanys config files it would be best to use a GKeyfile format instead of Notepads XML to store the settings.

Cheers
Lex




On Sat, Jan 29, 2011 at 2:32 PM, Lex Trotman <elextr@gmail.com> wrote:


On 30 January 2011 01:38, Todd Chambery <todd.chambery@gmail.com> wrote:
Hi all, 

Is there a mechanism for customizing the cursor movement keybindings in Geany?

I'm a happy Notepad++ user on WIndows, largely because it accommodates my "inverted T" editor navigation keybindings:


Notepad++ uses Scintilla underneath, maybe I can port these over?

Hi Todd,

You are correct that these keybindings are handled by Scintilla.  Scintilla can have the keybindings configured, but Geany currently does not have the ability to do it.  It could be a useful addition but someones got to do it (tm) patches welcome.

Cheers
Lex

PS doesn't have to be a GUI configurator, just loading a file would do

Thanks,
Todd

_______________________________________________
Geany mailing list
Geany@uvena.de
http://lists.uvena.de/cgi-bin/mailman/listinfo/geany



_______________________________________________
Geany mailing list
Geany@uvena.de
http://lists.uvena.de/cgi-bin/mailman/listinfo/geany



_______________________________________________
Geany mailing list
Geany@uvena.de
http://lists.uvena.de/cgi-bin/mailman/listinfo/geany