On 10 Oct 2007, at 19:29, Piero D'Ancona wrote:
I was thinking of a triggering mechanism where you can use multiple key combos: e.g. CTRL-R in LaTeX means 'run', when I press it a drop down menu appears (after a delay) like b = bibtex l = latex p = plain x = xetex so for instance CTRL-R + B runs bibtex. If I press CTRL-R+B quickly the menu does not appear and bibtex runs directly.
A better example: CTRL-D = delimiters When I press CTRL-D the command waits for a delimiter (menu after a delay). CTRL-D + ( -> a menu with a list of sizes appears: 1 = \left(...\right) 2 = \bigl(...\bigr) So in the end CTRL-D + ( + 2 produces \bigl(...\bigr)
Well, in principal would it be possible to write such a command. A general approach would be to write a normal tmCommand which is bound to e.g. CTRL-R. In that tmCommand one could write a TMTOOLS command "do waitForNextKeyDown '{time=2;}' ". waitForNextKeyDown waits for the next key and gives back the pressed key code. If no key was pressed for 2 seconds it gives you back -1. After having the pressed key code you can dispatch the task in the normal tmCommand. One thing is missing: a inline menu which will listen to a key and 'not only' for numbers 1 to 9.
But I don't know whether this feature is an issue for a plug-in. If one write such a command for e.g. the LaTex bundle and other users wants to use it they have to install that plug-in for invoking a command. I want to say the key binding stuff is an internal TM issue, not a circumferential one, at least by my opinion.
Hans