Hot Key Assignment? - Printable Version +- Forums (https://www.theblitz.club/message_boards) +-- Forum: The Firing Line (https://www.theblitz.club/message_boards/forumdisplay.php?fid=1) +--- Forum: Tiller Operational Campaigns (https://www.theblitz.club/message_boards/forumdisplay.php?fid=11) +--- Thread: Hot Key Assignment? (/showthread.php?tid=63157) |
RE: Hot Key Assignment? - vsadek - 11-22-2012 76mm, I know exactly what you mean. I went through AutoHotkey tutorial and used basic examples. Unfortunately, my knowledge is currently far less to answer you this question. Method I used is recommended for toolbar buttons activation. To actually go deeper through command menu is something I don’t know how to achieve (if possible at all). I would really have to go thoroughly through scripting methods to find the possibilities. Nevertheless, I will try to search this answer. My main obstacle is lack of time to do so: daytime job and family to feed. RE: Hot Key Assignment? - vsadek - 11-22-2012 Attached is the ZIP archive and inside is PzC.exe file. Extract this file and place it wherever you like: your desktop, create some separate folder etc. This EXE file is actually compiled AutoHotkey script. In this way you don’t have to download or install any other component from AutoHotkey. I tested this script end execution with success under: Win XP, Win 7 and Win 8. To run it just do usual mouse double-click. Once started it will place icon in a tray, in this way you will know script is active. I tested this script on all PzC titles (with latest updates applied) except: El Alamein ’42, Moscow ’41 and Sea Lion ’40. Once active together with PzC game it will add and activate following hotkeys: Ctrl+F - toggle Fixed Units Ctrl+S - toggle Spotted Units Ctrl+U - toggle Used Movement Points Ctrl+D - toggle Disrupted or Broken Units Ctrl+L - toggle Low Ammo or Fuel Ctrl+T - highlight Travel Mode To stop script from running, right-click tray icon and choose EXIT or use Ctrl+Q hotkeys for same effect. As stated before, this script is not perfect in any sense. It will malfunction if toolbar is not positioned in a top row. This is due to the method used within script and my lack of real deep knowledge of AutoHotkey scripting language. Somebody more experienced and versatile with AutoHotkey could probably do it far more better. Additional bonus: although conceived mainly for use with PzC titles, this script is also compatible with WWI: France ’14. Unfortunately, it is incompatible with Napoleonic Battles series. This requires separate script due to the different toolbar buttons arrangement in NB GUI. Have fun! RE: Hot Key Assignment? - vsadek - 11-22-2012 Attached is the ZIP archive and inside is PzC.ahk file. AHK is the extension used for AutoHotkey script files. This is a source code file for previously posted compiled AutoHotkey script. When script file is compiled it can be executed on operating system autonomously from developing environment. Basically, script files are just plain text; therefore this AHK file can be opened, read and edited with Notepad or some similar text editor. I post this for sole purpose if anybody is interested to see what this script looks like from inside. RE: Hot Key Assignment? - 76mm - 11-22-2012 Vsadek, will this script work if our screen resolution is different from yours? RE: Hot Key Assignment? - vsadek - 11-22-2012 76mm, script will function properly as long as this toolbar is positioned in top row, as in screenshot. If toolbar is repositioned in a second row, the toolbar buttons coordinates are changed and therefore script will not function properly. This situation can happen on monitors if lower resolutions are applied or if you manually resize game window in such manner. I use 17” and 19” monitors from 1280x1024 up to 1600x900 and do not have this issue. I presume some players could have. RE: Hot Key Assignment? - 76mm - 11-22-2012 It just seems like even if all of the buttons are on one row, their coordinates would also change if the resolution is different, although maybe I'm confused? I will try to look at this program this weekend if I have some time, it sounds interesting, especially if it could be used with menu items. RE: Hot Key Assignment? - vsadek - 11-22-2012 Button coordinates used (X, Y) are “In Active Window” values; when I tried different resolutions they didn’t change. Hopefully, it will work for you as well. Let me know is it any good when you try it. Regards RE: Hot Key Assignment? - 76mm - 11-25-2012 Vsadek, hi, your scripts worked great, and I found that it was very easy to add hotkeys for menu items as well--I've added the second set of hotkey commands below (note that my script retains your hotkeys, although I switched one from Ctrl-U to Ctrl-M). ********************** Ctrl+F - Highlight Fixed Units Ctrl+S - Highlight Spotted Units Ctrl+M - Highlight Units Which Used Movement Points Ctrl+D - Highlight Disrupted or Broken Units Ctrl+L - Highlight Low Ammo or Fuel Ctrl+T - Highlight Travel Mode Ctrl+U - To Top of Stack Ctrl+B - To Bottom of Stack Ctrl+C - Combine/Breakdown Ctrl+R - Recon Spotting Ctrl+G - Go On Foot Ctrl+P - Toggle Patrolling Ctrl+W - View Weather ***************** Thanks for mentioning AutoHotKey, it was super-easy to use, and these hotkeys should make playing PzC a much easier affair. I've attached the script file but for some reason it would not let me upload an ahk file, so before using it the file suffix should be changed from txt to ahk. RE: Hot Key Assignment? - vsadek - 11-25-2012 76mm this is great news! I see you found the way to actually go through menu items using Send. I should have use this method as well, instead of Click, to avoid messing up with coordinates. When you have the time, check this guys too: AutoIT They even have the free editor with syntax coloring and folding points options. RE: Hot Key Assignment? - 76mm - 11-25-2012 True, it might be easier/better if all of the macros work the same way, via the menus. Basically you hit Alt+first letter of menu item to open the menu, and then the first letter of the subitem to select it (if there are multiple subitems starting with the same letter, just press it as many times as necessary). |