/ doc / devdocs / modules / shortcut_guide.md
shortcut_guide.md
 1  # Shortcut Guide
 2  
 3  [Public overview - Microsoft Learn](https://learn.microsoft.com/en-us/windows/powertoys/shortcut-guide)
 4  
 5  ## Quick Links
 6  
 7  [All Issues](https://github.com/microsoft/PowerToys/issues?q=is%3Aopen%20label%3A%22Product-Shortcut%20Guide%22)<br>
 8  [Bugs](https://github.com/microsoft/PowerToys/issues?q=is%3Aopen%20label%3AIssue-Bug%20label%3A%22Product-Shortcut%20Guide%22)<br>
 9  [Pull Requests](https://github.com/microsoft/PowerToys/pulls?q=is%3Apr+is%3Aopen+label%3A%22Product-Shortcut+Guide%22+)
10  
11  ## Overview
12  Shortcut Guide is a PowerToy that displays an overlay of available keyboard shortcuts when the Windows key is pressed and held. It provides a visual reference for Windows key combinations, helping users discover and utilize built-in Windows shortcuts.
13  
14  ## Usage
15  - Press and hold the Windows key to display the overlay of available shortcuts
16  - Press the hotkey again to dismiss the overlay
17  - The overlay displays Windows shortcuts with their corresponding actions
18  
19  ## Build and Debug Instructions
20  
21  ### Build
22  1. Open PowerToys.slnx in Visual Studio
23  2. Select Release or Debug in the Solutions Configuration drop-down menu
24  3. From the Build menu, choose Build Solution
25  4. The executable is named PowerToys.ShortcutGuide.exe
26  
27  ### Debug
28  1. Right-click the ShortcutGuide project and select 'Set as Startup Project'
29  2. Right-click the project again and select 'Debug'
30  
31  ## Code Structure
32  
33  ![Diagram](../images/shortcutguide/diagram.png)
34  
35  ### Core Files
36  
37  #### [`dllmain.cpp`](/src/modules/shortcut_guide/dllmain.cpp)
38  Contains DLL boilerplate code. Implements the PowertoyModuleIface, including enable/disable functionality and GPO policy handling. Captures hotkey events and starts the PowerToys.ShortcutGuide.exe process to display the shortcut guide window.
39  
40  #### [`shortcut_guide.cpp`](/src/modules/shortcut_guide/shortcut_guide.cpp)
41  Contains the module interface code. It initializes the settings values and the keyboard event listener. Defines the OverlayWindow class, which manages the overall logic and event handling for the PowerToys Shortcut Guide.
42  
43  #### [`overlay_window.cpp`](/src/modules/shortcut_guide/overlay_window.cpp)
44  Contains the code for loading the SVGs, creating and rendering of the overlay window. Manages and displays overlay windows with SVG graphics through two main classes:
45  - D2DOverlaySVG: Handles loading, resizing, and manipulation of SVG graphics
46  - D2DOverlayWindow: Manages the display and behavior of the overlay window
47  
48  #### [`keyboard_state.cpp`](/src/modules/shortcut_guide/keyboard_state.cpp)
49  Contains helper methods for checking the current state of the keyboard.
50  
51  #### [`target_state.cpp`](/src/modules/shortcut_guide/target_state.cpp)
52  State machine that handles the keyboard events. It's responsible for deciding when to show the overlay, when to suppress the Start menu (if the overlay is displayed long enough), etc. Handles state transitions and synchronization to ensure the overlay is shown or hidden appropriately based on user interactions.
53  
54  #### [`trace.cpp`](/src/modules/shortcut_guide/trace.cpp)
55  Contains code for telemetry.
56  
57  ### Supporting Files
58  
59  #### [`animation.cpp`](/src/modules/shortcut_guide/animation.cpp)
60  Handles the timing and interpolation of animations. Calculates the current value of an animation based on elapsed time and a specified easing function.
61  
62  #### [`d2d_svg.cpp`](/src/modules/shortcut_guide/d2d_svg.cpp)
63  Provides functionality for loading, resizing, recoloring, rendering, and manipulating SVG images using Direct2D.
64  
65  #### [`d2d_text.cpp`](/src/modules/shortcut_guide/d2d_text.cpp)
66  Handles creation, resizing, alignment, and rendering of text using Direct2D and DirectWrite.
67  
68  #### [`d2d_window.cpp`](/src/modules/shortcut_guide/d2d_window.cpp)
69  Manages a window using Direct2D and Direct3D for rendering. Handles window creation, resizing, rendering, and destruction.
70  
71  #### [`native_event_waiter.cpp`](/src/modules/shortcut_guide/native_event_waiter.cpp)
72  Waits for a named event and executes a specified action when the event is triggered. Uses a separate thread to handle event waiting and action execution.
73  
74  #### [`tasklist_positions.cpp`](/src/modules/shortcut_guide/tasklist_positions.cpp)
75  Handles retrieving and updating the positions and information of taskbar buttons in Windows.
76  
77  #### [`main.cpp`](/src/modules/shortcut_guide/main.cpp)
78  The entry point for the PowerToys Shortcut Guide application. Handles initialization, ensures single instance execution, manages parent process termination, creates and displays the overlay window, and runs the main event loop.
79  
80  ## Features and Limitations
81  
82  - The overlay displays Windows shortcuts (Windows key combinations)
83  - The module supports localization, but only for the Windows controls on the left side of the overlay
84  - It's currently rated as a P3 (lower priority) module
85  
86  ## Future Development
87  
88  A community-contributed version 2 is in development that will support:
89  - Application-specific shortcuts based on the active application
90  - Additional shortcuts beyond Windows key combinations
91  - PowerToys shortcuts