On Fri, 14 Aug 2009 11:59:27 +1000, Lex wrote:
but I think the following should make it into a menu (actually a submenu, since I don't think they are commonly used enough to go in a top level menu) and I have suggested which new submenu to put them in.
Ctrl-K delete current line popup-edit Ctrl-T transpose current line popup-edit Ctrl-Shift-X cut line popup-edit Ctrl-Shift-C copy line popup-edit Alt-Shift-W select word edit-select and popup-select Alt-Shift-P select para edit-select and popup-select Alt-Shift-L select line edit-select and popup-select insert alt whitspace popup-edit indent space popup-indent undent space popup-indent prev indent popup-indent Ctrl-B matching brace edit-goto popup-goto Ctrl-M toggle marker edit-goto popup-goto Ctrl-. next marker " " Ctrl-, prev marker " "
Cool, thanks for this list. However, I fail to make any sense of the third column. Could you give some hint about what exactly "popup-edit", "popup-select" and the others mean? Thanks.
We better be careful, this could spark another GUI discussion ;-)
I guess it's already too late, haha.
I have been toying with the idea of adding a simple action recorder/replayer by recording key presses (in on_key_press_event
Maybe it's best to try realising this as a plugin from the beginning. There are certainly things missing in the API right now but missing bits could be added. As a plugin, your new code wouldn't affect the core, so reduces the risk of serious bugs (keybinding management is somewhat essential for an editor :D) and keeps independent.
function) and capturing menu activations by a signal emission hook on the activate signal.
How do you mean that? Do you want to connect to the activate signal of each single menu item? Maybe this can be avoided by connecting to the "button-press-event" or maybe better "button-release-event" of the main window ('main_widgets.window') and inside the handler determine which widget actually was activated. Not completely sure whether this will work but I think so. This way you don't need to modify any or at least not much code in Geany itself. Just an idea.
My question is, are there any actions that don't use one of these paths, and are there any that use both, for example any key presses that go to GTK and activate menus rather than call the callbacks directly in on_key_press_event or any other actions that are invoked directly without an activate signal?
Hmm, probably :(. Some keybindings call "activate" in callbacks.c of the corresponding menu items, other keybindings have their own code to do something and some other keybindings call other Geany functions directly which are also called from "activate" handlers. This certainly can be improved and unified but so far it just worked. For details, just have a look in src/keybindings.c and walk through the various handlers. But in general, all key presses should go first into on_key_press_event(), mouse actions are not that easy to handle I think as described above.
Regards, Enrico