Wednesday, June 10, 2009

Control Tab functionality for the TES4 CS

Well, my monitor is 14 inches. The lack of control tab functionality made the Construction Set impossible for me. I had posted my concerns in the always ready to help modder's community which only made me realize I am not alone in my annoyance. Someone suggested reverse engineering the CS : I am not a programmer. On the other hand I have some interest in scripting and I have used Autohotkey to create custom windows shortcuts. So I decided to try my strength : I really had to deepen into the autohotkey language and then I had to delve into the workings of the CS (using Winspectorspy). It took me 2 months (not a programmer remember ?) but here it is. I have tested it on XP SP3 Pro (in good shape), with the 1.2.04 CS, and it is still a beta but I post it cause I want to get some feedback (see below) and to see if there is still interest in it. And cause I think it is already damn useful. Ah yes, my original post in the beth forums was (also) about the annoying behavior of the render window losing focus. It proved difficult to correct it but it's in my to do list. Anyway pressing Control Tab just after closing a window should bring you back to the window you were using.

Features : adds control tab functionality (actually ALT TAB, but using Ctrl-Tab shortcut) in the Oblivion construction set. Meaning when pressing and holding Ctrl then pressing Tab you cycle in an alt tab way through the CS windows you have open. Shift reverses order. It works like the alt tab shortcut in Windows Explorer. When releasing the shortcut the previously focused window comes on top of the stack. Clicking on a window adds it to the stack (even if the script failed to auto-add it). Simple Control Tab would be much easier to implement but we want the real thing no ?
Additionally pressing Alt+m toggles the maximize/restore state of the window while Alt+n minimizes it out of your way. It is meant to be used with the object, cell, render, script and script\open windows (and a couple others maybe) which although not having maximize\restore\minimize button they can be maximized and minimized. With oter windows might work but with windows like "Reference" will give a funky result :)
Finally, pressing Cntrl+Shift+r reloads the script. When cpu load is very high this can prove necessary.

Usage : download, unzip, save CtrlTab_CS_v**.exe wherever in your drive. Open up the CS, load your data. Then run the CtrlTab_CS_v**.exe. A small green icon with an H on it will appear on system tray. By right clicking on it you can exit, pause or suspend the hotkeys. When having closed the CS the script should exit automatically. Voila !

Feedback needed : the script relies on sleep times tested on my machine which is rather clean, cpu not under big load etc. Should work fine anyway but I need some feedback on that. And feedback on the workings of the CS from people that are into WinAPI programming would be great - if anyone would care explain to me what's going on with the WM messages being sent we could join forces. The CS is full of surprises :)

Limitations : when clicking too fast on an object in the object window the window that pops up fails to get detected by my script. By too fast I mean so fast that actually the object window is given focus again instantly so the object's properties loose focus (and that's not the reason for having been clicked in the first place, so it is not a fatal flaw:). Either double click on the object again (not so fast) or mouse click on the object's window properties if visible. It will be detected. Now this is what makes it a beta.

To Do : correct limitation above. Add "focus back to last used window". Add keyboard shortcuts for various actions.

Download links : TesNexus || PlanetElderScrolls

Forum link :
http://www.bethsoft.com/bgsforums/index.php?showtopic=1000751

Did you know ?

The CS does not destroy the windows (like object properties, References windows etc etc) when you close them. It just hides them (no WS_VISIBLE). Is this a common practice ? This feature is what made my life difficult.