2

defined commands which I want to use in fast way. I tried to make a short hotkey, not the long default one for inserting own text blocks, but I did not find an option for that. Then I thought I would use AutoHotkey, but normally in TeXnicCenter when you select some text and use a command like \textit{}the text wont be overwritten. If I use Autohotkey for my customized command, I select my text and it will be overwritten.

Is there a solution I did not see?

2 Answers2

2

Well, it is possible at least for the F-keys. The following script copies the selected text, inserts \command{}, moves the cursor left and inserts the text again.

F4::
Send ^c
Send \command{{}{}}{LEFT}
Send ^v
Return
Uwe Ziegenhagen
  • 13,168
  • 5
  • 53
  • 93
1

It's been a while since this question was asked but I had the same problem and solved it with an AutoIt script:

include

$dll = DllOpen("user32.dll")
While 1   
   if _IsPressed("05") then 
      WinActivate("XXX")
      Send("!im2")
   EndIf 
   if _IsPressed("04") then 
      WinActivate("XXX")
      Send("!im1")
   EndIf
   Sleep(100)
WEnd
DllClose($dll)

Exit

Instead of "XXX" you type just the beginning of the window's name of TeXnicCenter (usually the project's name).

The parameter of the _IsPressed-function defines the hotkey (04 for middle mouse button, 05 for X1 mouse button).

"!im2" means it presses ALT+i to get into the insert menu, then m and 2

Moldevort
  • 1,295