Posted 20 years ago
by NSXDavid
So I have this situation, I need it such that when a user presses Alt+ENTER it acts as if they had pressed ENTER followed by the period key, followed by the up arrow followed by the END key. The period key unindents on a trigger.
So if the code looked like this:(Where | is where the cursor is) and they press ALT+Enter, we get:
(If smartindents and . triggers an unindent, again | is where I wnat the cursor to be).
I haven't figured out how to do this. My first attempt was to catch the ALT+ENTER, which is easy. But then what to do? I issue a SendKeys.SendWait("{ENTER}.{UP}{END}"); but unfortunately the ALT key is still being held down and so the {ENTER} key comes back through as ALT+ENTER. That leads to an infinite loop. If I avoid the infinite loop with a bool it still doesn't work because ALT+ENTER != ENTER as far as SyntaxEditor is concerned.
Any ideas how to make this happen?
-- David
So if the code looked like this:
if bla then|
printsomething
if bla then
|
.
printsomething
I haven't figured out how to do this. My first attempt was to catch the ALT+ENTER, which is easy. But then what to do? I issue a SendKeys.SendWait("{ENTER}.{UP}{END}"); but unfortunately the ALT key is still being held down and so the {ENTER} key comes back through as ALT+ENTER. That leads to an infinite loop. If I avoid the infinite loop with a bool it still doesn't work because ALT+ENTER != ENTER as far as SyntaxEditor is concerned.
Any ideas how to make this happen?
-- David