Setting Up a Custom Zoom Level

Share and discuss strategies for playing the game, and get help and tips from other players.

Moderator: Forum Moderators

Post Reply
RobertLM78
Posts: 2
Joined: April 21st, 2018, 1:11 am

Setting Up a Custom Zoom Level

Post by RobertLM78 »

This is basically in reply to two threads, on the forums here asking about zoom levels being restored.
https://forums.wesnoth.org/viewtopic.php?t=23310
https://forums.wesnoth.org/viewtopic.php?t=35821

Are you tired of having to press '+' a specific number of times after loading a game? Well, this doesn't save the state, but it does do the next best thing. On the suggestion of Strelock on the #wesnoth IRC channel, I found a solution for both Linux and Windows using an external utility.

For Linux that utility is Autokey, and for Windows it is AutoHotKey
github.com/autokey/autokey/wiki
autohotkey.com

Both are similar, using scripts to send keyboard events via hotkeys and/or abbreviations. Autokey uses python while AutoHotKey has its own scripting language.

Since I run Linux, I'm not sure of the exact workings of AutoHotKey, but I'm sure this 'tutorial' (using Autokey 0.90) below should still be helpful.

If you install AutoKey from your package manager *make sure that the Autokey launcher in your menu does NOT have the '-c' option*. After removing that as needed, and getting to the main configuration window, go to Sample Scripts on the lefthand side and click new. You can name your script whatever you like (I named mine 'BFW Zoom'). In the script, type the following line, using as many plus signs as you'd like zoom levels:
keyboard.send_keys("{++++++++}")

Next set the Hotkey you'd like to use (I used NumPad 5).

Then set the window filter. To do that click 'Set' and then 'Detect Window Properties'. After clicking that bring your Wesnoth window to the top. It takes a small moment to detect, but when it's done you should get something like this:
wesnoth-1.12.wesnoth-1.12

Lastly, hit save. If you've set things up properly, you should now have a custom zoom in The Battle for Wesnoth, restoring the level to your favourite spot. :D
Post Reply