mfn / GtkRadiant

Note: this has been long dormant, please check
https://github.com/TTimo/GtkRadiant
Other
13 stars 3 forks source link

Update shortcuts.sample.ini, test shortcuts, improve commandlist.txt #63

Open AEonZR opened 14 years ago

AEonZR commented 14 years ago

Looking into how much actually works and what needs to be updated concerning external shortcut remapping via shortcuts.ini file.

This should clear up any potential issues regarding shortcuts. Plus probably "motivate" the addition of more command hooks, to let folks bind more functions.

AEonZR commented 14 years ago

Well I have it almost done:

Alas, there is an issue with commands that get assigned TWO or more keys:

{"Patch TAB", GDK_Tab, 0x00, ID_PATCH_TAB, "menu_patch_tab"},
{"Patch TAB", GDK_Tab, 0x01, ID_PATCH_TAB, "menu_patch_tab"},

and e.g.

{"SetGrid1", '1', 0, ID_GRID_1, "menu_grid_1"},
{"SetGrid1", GDK_KP_1, 0, ID_GRID_1, "menu_grid_1"},

In the code this is no problem, but the way the original code reads the shortcuts.ini makes it impossible to bind e.g. KP_1 and 1 to SetGrid1.

I noticed this by creating a shortcut_cmds.txt in the editor without re-binding keys (=a clean internal shortcut list), then copy/pasted that complete list into shortcuts.ini to then check what the editor console says to all this when restarting the editor. All bindings work... except for the cases above. Luckily I added debug code on the console that warns about this.

As long as you do not try to rebind commands used twice or more via shortcuts.ini you are fine though... hmmm...

Alas, trying to fix this would mean having to pretty much recode the (IMO, roundabout) way how the shortcuts.ini shortcuts are read.

AEonZR commented 14 years ago

Updated a shortcuts.ini.sample16 file, giving many tips plus explaining how to best bind keys.

Removed the commands that are bound twice, to avoid the temptation to do so. These are (presently):

SetGrid1, SetGrid2, SetGrid4, SetGrid8, SetGrid16, SetGrid64,
SetGrid128, SetGrid256, SetGrid32, Patch TAB, and ToggleGrid.
AEonZR commented 14 years ago

I posted an updated shortcuts.ini.sample16 here:

http://aeonzr.pastebin.com/m7dd8f9ca

Should help folks set up their keymap more easily.

mfn commented 14 years ago

I made a "gist" here at github:

http://gist.github.com/276250

Just to "try it out", I was curious, because it's actually a git versioned pastebin .. weird.