[UCR Plugins] Zoom.ahk +more
Posted: 12 Nov 2016, 17:20
Edit: 2019-08-27
Updated the Zoom plugin.
This thread houses the following custom user plugins for UCR, descriptions are available a few posts down, see,
Other user plugins:
Zoom - Update - Version 2.1.1 (2017-04-10)
Update - Version 2.1.2 (2018-12-10): Bug fix.
Update - Version 2.1.1 (2017-04-10): Fixed bug fix bug
Update - Version 2.1 (2017-04-09): Bug fix, Added new feature: Show cursor on zoom window, mapped from source rectangle.
Mini update (2017-01-04): Added CodeThread to linkTypes array.
Update - Version 2. (2016-12-05)
This has been, quite extensively, updated. Most importantly, I have fixed a bug so you can now have multiple instances of the plugin without weird results. The previous description still holds, these are the new features, in summary:
Features for convenience
Additional credits.
Original post. (2016-11-12) Edit: removed code, use v2.1.
Introduction.
This is a user plugin for Universal Control Remapper - UCR, v0.1.5, with the purpose to enable zooming in or out on any part of any window.
This was originally a request at this thread. Some features are a consequence of that.
Features.
List of main features:
Download UCR, unzip, no installation required, save this plugin to UCR\Plugins\User\zoom.ahk. Start UCR, Select Zoom from the Plugin Selection dropdown list, click Add.
Setup.
You need to select a hotkey to toggle the zoom, and a source window, that is, select the window to zoom. You can choose to zoom the currently active window.
Options should be mostly self-explanatory, if you have questions, please ask.
About the implementation.
The display of the source window on the zoom pop-up window, is handled by the DWM, specifically, a thumbnail relationship between the source window and the pop-up window is registred, then it is just a matter of making some simple coordinate tranformations to get the correct size and placement.
To make something similar, or to make this independent of UCR, you basically just need the dwm_ functions, the rest of the code is mostly settings handling and simple coordinate tranformations. You can follow the links in the comments to learn more, or, feel free to ask.
Known limitations and problems.
A brief comment on the choise of format, although this is not a control remapping, making it as a UCR plugin, is a convenient way to wrap a simple class in a GUI, making it easy to use for non-programmers (most gamers). Also, save me the time to explain how to use this
Good luck and have fun!
Updated the Zoom plugin.
This thread houses the following custom user plugins for UCR, descriptions are available a few posts down, see,
- Zoom - this post (Updated: 2017-04-10)
- WindowStyler
- CodeThread
- Developer plugin
- Recent: APM - Action per minute counter
- New: Cursor - conceptual, use mulitple/mice cursors.
Other user plugins:
- ButtonsToButtons by smootchat - (Remaps 16 buttons as well as a shift button to assign another 16 virtual buttons) -
Zoom - Update - Version 2.1.1 (2017-04-10)
Update - Version 2.1.2 (2018-12-10): Bug fix.
Update - Version 2.1.1 (2017-04-10): Fixed bug fix bug
Update - Version 2.1 (2017-04-09): Bug fix, Added new feature: Show cursor on zoom window, mapped from source rectangle.
Mini update (2017-01-04): Added CodeThread to linkTypes array.
Update - Version 2. (2016-12-05)
This has been, quite extensively, updated. Most importantly, I have fixed a bug so you can now have multiple instances of the plugin without weird results. The previous description still holds, these are the new features, in summary:
Features for convenience
- Click and drag to select custom zoom box coordinates.
- Click and point to select custom pop-up location.
- Linking of multiple plugins, such that one hotkey can trigger more than one. (Very experimental, code was made in another context, seems mostly ok)
- On-the-fly zoom, i.e., click and drag over area of interest, to zoom in (or out) on it. (Highlighted in demo 2)
- Option to make zoom window click-through-able, this prevents it from capturing the mouse, and hence taking away control from the source (game). Recommended for zooming an FPS, the original purpose of this plugin.
- Option to hide the source. Caveat: Don't use together with Source->Use active window. (Highlighted in demo 1)
- Interactive clicks, (left and/or right) mouse clicks on the zoom pop-up are mapped to the source. Two methods, 1) ControlClick, source need not be visible, 2) Click, more reliable but source needs to be visible, no drag possible. (Highlighted in demo 2)
- Optional hotkey to move the zoom pop-up.
- Demo 1, shows hiding of source, and interactive clicks, method 1. Zooms out a browser window and interacts with the youtube video player
- Demo 2, shows on-the-fly zoom, randomly zooming some small images.
Additional credits.
- Mouse effects for Demo 1:
mright wrote: Mouse ripple effect
- Videos recorded with ShareX.
- Videos hosted by https://sendvid.com.
Original post. (2016-11-12) Edit: removed code, use v2.1.
Introduction.
This is a user plugin for Universal Control Remapper - UCR, v0.1.5, with the purpose to enable zooming in or out on any part of any window.
This was originally a request at this thread. Some features are a consequence of that.
Features.
List of main features:
- The zoom is live, meaning any change on the source window is imediately seen on the zoom window.
- Toggle zoom on/off or zoom only while holding the selected hotkey.
- Choose whether to include non-client area or not.
- Point and click to select source (Source tab -> Get Source button).
- Option to specify a custom rectangle on the source window to zoom. By default, the center of the window is zoomed. (See preview 1)
- Option to specify where on the screen the zoom pop-up window will be placed.
- Preset pop-up locations to match source corner, could be useful for something like a mini-map zoom. (See preview 2)
- Option to disable zoom when source is not the active window.
- By courtesy of the UCR, settings are preserved and very nice hotkey selection functionality.
- Very low CPU usage.
Preview 1
Preview 2
Installation.
Download UCR, unzip, no installation required, save this plugin to UCR\Plugins\User\zoom.ahk. Start UCR, Select Zoom from the Plugin Selection dropdown list, click Add.
Setup.
You need to select a hotkey to toggle the zoom, and a source window, that is, select the window to zoom. You can choose to zoom the currently active window.
Options should be mostly self-explanatory, if you have questions, please ask.
About the implementation.
The display of the source window on the zoom pop-up window, is handled by the DWM, specifically, a thumbnail relationship between the source window and the pop-up window is registred, then it is just a matter of making some simple coordinate tranformations to get the correct size and placement.
To make something similar, or to make this independent of UCR, you basically just need the dwm_ functions, the rest of the code is mostly settings handling and simple coordinate tranformations. You can follow the links in the comments to learn more, or, feel free to ask.
Known limitations and problems.
- Requires Windows Vista or newer OS.
- Probably doesn't work in fullscreen.
- Hide mouse cursor option doesn't seem to work reliably. I do not know why.
- You cannot select mouse wheel up or down as hotkeys (for now).
- When Only zoom client frame-option is used, some source windows, eg ones with a menu, might not be correctly zoomed. This is due to GetClientRect and DWM not agreeing on what is the client-area. As a workaround, specify a custom source rectangle.
- All combinations of available settings are not really meant to used, but you still can. Result may be awkward.
- Limited testing.
- evilC for making UCR.
- ShareX for software to record gif, very nice tool, check it out!
- Gif previews are hosted by giphy.com - I do not know for how long they will be available.
A brief comment on the choise of format, although this is not a control remapping, making it as a UCR plugin, is a convenient way to wrap a simple class in a GUI, making it easy to use for non-programmers (most gamers). Also, save me the time to explain how to use this
Good luck and have fun!