UNPKG

gpii-windows

Version:

Components of the GPII personalization infrastructure for use on Microsoft's "Windows" ™

36 lines (22 loc) 1.63 kB
# App Zoom Sends a zoom in/out signal to the currently activated application window. The actual signal differs between applications, and it's usually a simulated key press or ctrl+mouse wheel. ## How it works ### Active Window Because the QSS is usually the active Window when this feature is used, and it's the previously activated window that needs to be manipulated, Windows activations are monitored by listening for [WM_SHELLHOOKMESSAGE](https://msdn.microsoft.com/library/ms644989) messages. ### Zooming In order to send the zoom command, one of the following things could be performed: #### Control + mouse wheel This is a widely used mouse gesture for zooming in and out. The [WM_MOUSEWHEEL](https://docs.microsoft.com/windows/desktop/inputdev/wm-mousewheel) message is sent to the application. This message specifies the centre of the window for the mouse coordinates, and the fact that the CTRL key was down. Some applications may use `GetAsyncKeyState`/`GetKeyState` to determine if the CTRL key is down. In that case the key press is simulated. Other applications (Edge) don't even respond to windows messages, and seem to take input via some other manner. In this case, the mouse cursor is moved onto the window, the wheel movement is simulated, then the cursor is moved back. #### Key press Some applications don't respond to the wheel event very well. Fortunately, they may have a keyboard shortcut to adjust the zoom (usually `CTRL + "-" / "="`). The [WM_KEYDOWN](https://msdn.microsoft.com/library/ms912654) and [WM_KEYUP](https://msdn.microsoft.com/library/ms646281) messages are send to the Window.