-
Notifications
You must be signed in to change notification settings - Fork 31
Code Breakdown
cafali edited this page Aug 1, 2024
·
11 revisions
-
keyA_codeandkeyD_codeare initialized to 'A' and 'D' respectively, but can be changed based on the configuration file. -
keyStateskeeps track of whether specific keys are pressed. -
hHookis used for the keyboard hook. -
nidis used for the system tray icon data.
- Loads the key bindings from a configuration file.
- Creates a named mutex to ensure only one instance runs.
- Registers a window class and creates a window.
- Initializes and adds a system tray icon.
- Sets a low-level keyboard hook to intercept key presses.
- Runs a message loop to handle Windows messages.
- Handles key down and key up events, managing the active and previous key states.
- Initializes the system tray icon.
- Provides a context menu for exiting the application.
- Loads configuration settings from a file or restores from a backup if the file is missing.
- The
CreateDefaultConfigandRestoreConfigFromBackupfunctions handle missing or corrupt configuration files.
