Download (Windows, Linux and OS X)
Link contains download archive with
all my plugins.
Only works on the latest DFHack r3 (see the dfhack thread). Follow the instructions in the included readme for installation. The relevant file for just this plugin is mousequery.plug.*
Mouse PluginI've made several improvements to my mouse plugin that should hopefully make it more useful. This plugin didn't use to have its own thread, but I felt it has enough functionality now to warrant one. Please see the subsequent sections for new functionality.
Smart QueryLeft clicking on items, creatures, buildings, etc will make the game open the appropriate query menu for it, in a somewhat context sensitive fashion. For example clicking a workshop will open the building (q)uery menu with the cursor placed on the workshop (it simulates you pressing "q" then moving the cursor to the workshop). Clicking on a dwarf or creature will open the (v)iew menu with the cursor placed on the unit. Clicking an item or empty floor will open the loo(k) menu on that item.
Clicking on one location multiple times will cycle through the 4 "query" menus that DF uses: (q)uery building, (v)iew units, loo(k), view i(t)ems, with the cursor placed at that location.
Right mouse button cancels the query mode.
Live ViewIf you have the menu panel open, then hovering your mouse over a tile will display a list, telling you what's on that tile. It's similar to what you would see if your were to loo(k) at that tile. The following screenshot is an example of what happens when I hover over the seed bag circled in yellow:
Point & Click SupportIf you left click on a tile while the ingame cursor is active, this will simulate moving the cursor to that location and pressing Enter. Furthermore, when in the material selection menu for building, left licking simulates pressing Shift-Enter (see below for how you can make the mouse wheel scroll this menu). This should allow you to do more actions with the mouse, such as clicking two corners to designate.
If you use my
automaterial (Construction Helper) plugin, then you can enable box mode for construction placement, which will let you use this plugin to designate walls, floors etc by simply clicking the two corners. Using "auto type select" and "auto material select" will make construction placement with the mouse even faster. There are a couple of bugfixes to automaterial included in this updated to help it work together with this plugin, so please update automaterial.plug.* as well.
If you use my
Building Plan plugin, then you can turn on planning mode for furniture, which will let you place buildings fairly quickly with the mouse.
Map ScrollingUnfortunately it's not possible to allow clicking and dragging the map, because it doesn't look like dfhack can detect "mouse key up" events. I've made it so that in default mode if you right click towards the edge of the map that causes it to scroll in that direction. Note that if "cursor tracking" is enabled (see next section), the game will automatically cause the map to scroll when the cursor is enabled (because moving the ingame cursor to the edge of the map causes it to scroll anyway).
You can also enable "edge scrolling", where the map scrolls automatically if you move the mouse to the edge of the screen, which is probably more convenient once you get used to it. To enable this add the following to dfhack.init:
mousequery edge enable
When edge scrolling is enabled it also turns on "cursor tracking".
Cursor TrackingBy default moving the mouse while the ingame cursor is active doesn't move the cursor itself, you will just see a yellow X "ghost cursor" under the mouse. Left clicking a tile automatically moves the cursor there and sends an "ENTER" keypress. If you want the cursor to move with the mouse, add this command to your dfhack.init:
mousequery track enable
I don't have it turned on by default, because some people might not like the edge scrolling side effect this has: when the cursor is moved to about 5 tiles from the edge of the screen, the game automatically causes the map to scroll. On its own this could be annoying if using the mouse, because it can cause the map to zip across screen. I've reduced the effect of this by adding a short delay to cursor movement when the mouse is at the edges. This allows you to use the mouse when you want to edge scroll the cursor, but enough time to react and stop it when you move to the edge accidentally.
Extra DetailsIf you type "mousequery" into dfhack, you'll get the full commandline help for a couple more functions. You can now disable the right mouse button handling entirely if you want to use the plugin in conjunction with Mouse Fortress. You can also enable edge scrolling in default mode and adjust edge scroll delay.
KeybindingsChanging some Df keybindings will make using the mouse more convenient. I've remapped my scrollwheel to change z-levels instead of zooming, as well as enable it to scroll secondary menus, such as the material selection menu. With the support in this plugin for left clicking to pass a "select all" to the materials menu, using the scrollwheel to select items makes more sense.
You can change DF keybindings by escaping to the main menu, choose keybindings->General. Find the "Zoom in/out" entries and the "Move view/cursor up/down (z), aux" entries, then swap the keybindings of these. You can delete existing keybindings with backspace and add new ones. This will let you change z levels with the wheel and zoom with Ctrl+5/Shift+5.
Next find the "Move secondary selector up/down" entries and add
additional keybindings to use the mouse wheel for these, leaving the existing +- bindings, so you can use both keys and wheel to scroll. It's ok to have two bindings for the wheel, because the two actions are used in different modes.