One of the downsides to this is that the test/code cycle can get broken up by continually having to switch windows. With a full blown IDE you just hit some magic key and it all happens. What I wanted was this magic to happen but still keep the flexibility of having the 2 different tools.
Enter AutoHotKey. AutoHotKey allows you to script a whole bunch of windows stuff and it also allows you to setup system wide hot keys. So, I wrote a simple script that looks like this:
^+e::
WinGetActiveTitle, Title
IfWinExist Console
{
WinActivate
SendInput {Up}
SendInput {Enter}
WinActivate, %Title%
}
This script is set to register as the global hot key Control-Shift e. What is does it get/store the current window title, activate the console window, press the up key (to activate the last command), press enter and then reactivate the previous window. Works like a charm. Since I got it working I'm unsure how I lived without it.
Now that I know how to do it, I'm thinking of all kinds of global hot keys that I might be able to use.
No comments:
Post a Comment