Thanks for your response.
this sounds like a handy macro.
some thoughts/questions:
* would you have the same problem if someone pasted text containing "{"?
No, the loop does not occur on paste. Only when invoked via the keyboard.
However, pasting does not provide anywhere near the flexibility of the keyboard.
* it seems that you need some way to distinguish typed input from inserted input. failing that you could require all key assignments use a CTRL or ALT modifier.
Indeed. But the macroText is not inserted. It's actually pushed onto the keyboard queue. Thus there is no distinction between chars originating from the macro and those typed at the keyboard by the user.
An Alt-N macro that contained "{Alt}n" puts me in the same hard place.
With wxWidgets, chars cannot be "inserted" into native controls, they can only come from the keyboard. If the plugin attempted to use the widgets facilities, SetValue(), ScrollWindow() etc, it'd have to determine the control type, the function to use, etc etc. It'd have to recreate the wxWidgets wheel.
* are you trapping the "changed" status of the cbEditor rather than the "keystroke" status?
KeyMacs is not trapping any status at all right now. It's invoked by the menu system, looks up the menu name, matches that to a keyMacro of the same name, translates its menuText to keystrokes and pushes 'em into the keyboard queue.
Edit: 2006/12/11 2:27 PM
Ah, I see what you mean. But the cbEditor changed flag may not be raised if the macro changed say the find dialog. {Ctrl}f"{"{ENTER} would not raise the "changed" flag, but it would cause the loop.
It does know the last macro name, the time, and the macroText.
* does the plugin operate only when focus is in the editor window or on all C::B windows?
I have restricted the macro to execute only when invoke from a CBeditor window. However, the macroText can open/close/switch/start pgms/invoke other menus etc. eg. "{Ctrl}fFIXME{ENTER}" opens the find dialog, types FIXME into the find control and executes the find.
* it would be nice if this plugin was integrated with "Keyboard shortcuts"
hope to see it working soon
I suspect that in future, the KeyBinder plugin will be deprecated. So integration might not be forthcoming.
Got any ideas about that loop problem?