I wrote this script to help navigate the quick render feature in Terragen 2. I use a touchpad with my lappy, which makes the navigation system a little awkward (Alt-Click and Shift-Alt-Click), and I don't even have a middle mouse button! So, I thought this was a great opportunity to incorporate a nifty little script I picked up. I've got a wired Xbox 360 controller that I've been using as a mouse via an Autohotkey script. I'm hoping to set a trend. I think that having your most commonly used functions mapped on to such an ergonomic device as an Xbox controller is much better and more efficient than using a keyboard mouse combination in many situations.
Most of the code comes from a sample on the autohotkey web site, designed for use with any joystick, but I've tweaked it a bit to take advantage of the button layout on the controller. It also holds down the Alt key when holding down any of the "mouse" buttons (A: Left, B:Right, and Left analog click: Middle) so that flying around the quick render is very easy. I would much rather Terragen 2's quick render navigate more like a first person shooter or flight simulation, but this will do for now.
I'm a huge advocate for Autohotkey. For those who don't know, Autohotkey is a completely free tool used for writing scripts and hotkeys. Its really easy to use for simple things, but it is also incredibly robust, I have used it at work on many occasions. Sometimes its easier to write an autohotkey script than an all-out program. As a programmer with many large projects in multiple languages, its nice to create all of my small "one-offs" in such a well written language as AHK, but i've also used it to perform large and complex tasks, and nice looking GUI's The recorder doesn't hurt either for quick macros. </SHAMELESS PLUG>
I have included both an AHK file and a compiled version. The compiled version should run on any Windows based machine (haven't tried it on Vista yet though), Please take a look at the code in the AHK and leave some comments/suggestions. I'm sure that there is a lot more i could do to make this more useful. The original script can be found in the documentation for autohotkey or at
http://www.autohotkey.com/docs/scripts/JoystickMouse.htm -Lee Reynolds
Keymap:
Left analog - Move Mouse
Left analog click - Zoom*
Left Bumper - Backspace
Right Bumper - Delete
Left Trigger - Page Up
Right Trigger - Page Down
POV - Up, Down, Left, Right
A - Orbit*
B - Translate*
X - Copy
Y - Paste
* denotes specific to TG2